-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Master port #50773: zypper's locks to holds #56935
Conversation
a88e79a
to
89cd23a
Compare
I wanted to get this master port up as part of addressing #56922 and customer support issues related to the |
I'm missing a bit of context here. Seems like #50773 was originally merged but then reverted again!? Was it incomplete? |
Ah, sorry! I missed that that was |
89cd23a
to
6d18a78
Compare
The functions being deprecated here should include something similar to the following at the top of their respective function docstrings: .. deprecated:: 3002,3001.1
This function is deprecated. Please use ``unhold()`` / ``hold()`` instead. I opened a different issue related to how this guidance should be included in our Deprecating Code guidance: #58208 |
36d10c0
to
85854cd
Compare
85854cd
to
299c195
Compare
356be9b
to
8abf515
Compare
@oeuftete Can you resolve the conflicts in |
8abf515
to
ee38037
Compare
salt/modules/win_pkg.py
Outdated
for k in name_map: | ||
u_name_map[k] = name_map[k] | ||
return u_name_map | ||
return get_repo_data(saltenv).get("name_map", {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need to create a reverse map here. Should be:
u_name_map = {}
name_map = get_repo_data(saltenv).get("name_map", {})
for k in name_map:
u_name_map[k] = name_map[k]
return u_name_map
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Even from my commit comment, I'm not 100% sure why I had to mess with this file four months ago (and then messed it up), but I believe it was to satisfy pre-commit requirements at the time. This file has no business being changed in this PR if it doesn't need to, so I'm going try to just rip the commit changing this out.
Interesting that no existing tests caught my mistake, this might be something to address.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's meant to return the reverse map, I believe it was broken before...
- u_name_map = {}
- name_map = get_repo_data(saltenv).get("name_map", {})
-
- if not six.PY2:
- return name_map
-
- for k in name_map:
- u_name_map[k] = name_map[k]
- return u_name_map
+ return get_repo_data(saltenv).get("name_map", {})
The reverse map would never be returned under py3. So that's why this was taken out when I de-sixed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@twangboy It looks like the original change is no longer required (the Windows tests pass), so I don't need to touch this module in this PR. If the lack of the reverse map is a bug, that should be addressed in a separate PR.
ee38037
to
3e15435
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests.integration.states.test_pkg.PkgTest.test_pkg_017_installed_held_equals_false
is now failing, which is related to the changes here.
E AssertionError: 'held' not found in 'The following packages were installed/updated: lynx'
This is expected by the pkg.installed state, and is consistent with other package states.
3e15435
to
5e0397e
Compare
Ready for review again. Thanks to @garethgreenaway for helping sort out the latest test failure. |
Why were these renamed in the first place? The other two lock functions ( Zypper has no concept of "hold". It calls them package locks. |
Port of #50773.
What does this PR do?
Deprecates
add_lock
andremove_lock
in favour ofhold
andunhold
functions.What issues does this PR fix or reference?
Fixes: #56922 (as part of making the original PR work)
Merge requirements satisfied?
hold
/unhold
activated a handful of package integration tests (which flushed out some bugs)Commits signed with GPG?
No