Fix import for WinRM version check#68768
Conversation
|
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here's some information that may help as you continue your Salt journey. There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. |
|
Could we get a changelog and a test for this. Maybe just verify that "HAS_WINRM" is true. |
|
Yes of course, I didn't include it as it's a partial rollback to what is was before: |
|
Ok, hope this will be enough, I won't have time to create a proper test but updated the ticket with what I could. |
PyPI's package is named pywinrm.
The importlib.metadata.version("winrm") call raises PackageNotFoundError which isn't caught by except ImportError, crashing the block and leaving winrm undefined despite being importable.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 3006.x #68768 +/- ##
==========================================
- Coverage 60.80% 60.80% -0.00%
==========================================
Files 3359 3359
Lines 461913 461913
Branches 95545 95545
==========================================
- Hits 280810 280805 -5
- Misses 155042 155049 +7
+ Partials 26061 26059 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
PyPI's package is named pywinrm.
The importlib.metadata.version("winrm") call raises PackageNotFoundError which isn't caught by except ImportError, crashing the block and leaving winrm undefined despite being importable.
What does this PR do?
What issues does this PR fix or reference?
Fixes salt-cloud with Windows minions using Winrm
Previous Behavior
salt-cloud crashes when using winrm to deploy windows minion.
New Behavior
salt-cloud deploys windows minion correctly.
Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
Yes/No