CLI: don't override flags for a release when editing it #4484
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.
Because the defaults in release_options for composed_by_bodhi and
create_automatic_updates were set to True and False respectively,
and
edit_release
uses those options, when you edit a release -even if you don't specifically pass any argument to set either of
those flags - the CLI will change whatever the current values of
those flags are for the release you edit to those defaults. So
if you edit a release with composed_by_bodhi set to False and
don't pass
--composed-by-bodhi
or--not-composed-by-bodhi
,the flag will be changed to True.
This solves that by changing the defaults to None - which causes
edit_release
to properly leave them at their current valuesunless the user specifically passed a relevant argument - and
having
create_release
set them to the expected default valueif they come in as None.
We also throw away the explicit handling of composed_by_bodhi
that was added to both functions in 3de3588, because it is
unnecessary. It is already coming into both functions as a kwarg;
handling it like this changes nothing at all. Just adding the
option to release_options was all that was ever needed.
Signed-off-by: Adam Williamson awilliam@redhat.com