Better handling of enabled/disabled arguments in pkgrepo.managed #39251
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 forthe
pkgrepo.managed
state under theYUM/ZYPPER
section, while thedisabled
param was listed under theAPT
section.disabled
isn't a thing in yum/dnf, so there was never any reason totry 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 passingenabled
in APT will pass the opposite value asdisabled
, andvice-versa on the other platforms. This allows
enabled
/disabled
to beused interchangeably.
It also more gracefully handles booleans in yum/dnf/zypper, so that a
bool can be properly compared to a 1/0 value.