Skip to content
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

Better handling of enabled/disabled arguments in pkgrepo.managed #39251

Merged
merged 1 commit into from Feb 8, 2017

Conversation

terminalmage
Copy link
Contributor

@terminalmage terminalmage commented Feb 8, 2017

This reverses the decision made in #35055 to deprecate the enabled
parameter in this state. This was a poorly-conceived decision, likely
made because the enabled param was not included in the docstring for
the pkgrepo.managed state under the YUM/ZYPPER section, while the
disabled param was listed under the APT section.

disabled isn't a thing in yum/dnf, so there was never any reason to
try to shoehorn it in. Not to mention the fact that the disabled
argument isn't even supported in Zypper, which effectively breaks Zypper
support.

This commit normalizes enabled/disabled based on platform, so passing
enabled in APT will pass the opposite value as disabled, and
vice-versa on the other platforms. This allows enabled/disabled to be
used interchangeably.

It also more gracefully handles booleans in yum/dnf/zypper, so that a
bool can be properly compared to a 1/0 value.

This reverses the decision made in saltstack#35055 to deprecate the "enabled"
parameter in this state. This was a poorly-conceived decision, likely
made because the "enabled" param was not included in the docstring for
the pkgrepo.managed state under the "YUM/ZYPPER" section, while the
"disabled" param *was* listed under the "APT" section.

"disabled" isn't a thing in yum/dnf, so there was never any reason to
try to shoehorn it in. Not to mention the fact that the "disabled"
argument isn't even supported in Zypper, which effectively breaks Zypper
support.

This commit normalizes enabled/disabled based on platform, so passing
"enabled" in APT will pass the opposite value as "disabled", and
vice-versa on the other platforms. This allows enabled/disabled to be
used interchangeably.

It also more gracefully handles booleans in yum/dnf/zypper, so that a
bool can be properly compared to a 1/0 value.
Copy link
Contributor

@rallytime rallytime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is much better and handles the system defaults (disabled in apt vs. enabled in yum/dnf/zypper) which were not considered before. Thanks @terminalmage

@rallytime rallytime merged commit c1d16cc into saltstack:2016.3 Feb 8, 2017
@terminalmage terminalmage deleted the pkgrepo-managed branch April 25, 2017 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants