-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
apt module : take care about autoremove in upgrade function #30747
Conversation
shipit |
cc @kbrebanov @elasticdog, I ping you as namespace maintener, to review this PR since mgwilliams seems not available. |
This would not change the functionality, but as a matter of consistency with the rest of the code, what would you think of passing the autoremove parameter when calling the upgrade function instead of looking up the value thru the module parameters? Like when the install and remove functions are called. |
@kbrebanov I was thinking about it but I don't really agree with how args are managed... But I would like to talk a little bit about attributes management in this module.
|
@dj4ngo I think the upgrade call on line 984 may also need to be modified. I agree with you that attributes management could probably be improved. |
@kbrebanov your right, I did a missmatch in my amend .... I amend again my commit. |
shipit |
@mscherer Could you review this PR again ? I had to modify it since your shipit message ... Thanks |
@@ -722,7 +722,13 @@ def cleanup(m, purge=False, force=False, operation=None, | |||
|
|||
def upgrade(m, mode="yes", force=False, default_release=None, | |||
use_apt_get=False, | |||
dpkg_options=expand_dpkg_options(DPKG_OPTIONS)): | |||
dpkg_options=expand_dpkg_options(DPKG_OPTIONS), autoremove=None): |
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.
Shouldn't the default for autoremove be "False" rather than "None" ? (just nitpicking)
shipit |
I suspect we are missing a few fixes. For example, what happen if there is no aptitude, but someone explictely say "autoremove=yes", the module should fail and/or warn the user, no ? |
cherry-picked for 2.4.2beta1 |
SUMMARY
Fixes #30516
Take care about params autoremove in upgrade function.
ISSUE TYPE
COMPONENT NAME
packaging/os/apt
ANSIBLE VERSION