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

Fixes #37151 - Add --force flag to content overrides #973

Closed
wants to merge 1 commit into from

Conversation

chris1984
Copy link
Member

@chris1984 chris1984 commented Nov 26, 2024

What are the changes introduced in this pull request?

  • We only support enabled as a value on content overrides, adding a flag that makes the user add --force for anything other than enabled.
  • Increased the line length to 150 from discussions with Quinn on my last PR since Katello is at 200.
  • Added some unit tests around using the new --force option and validating we error out with invalid usage if the flag is not present.

Considerations taken when implementing this change?

  • Found some left over stuff from syspurpose addons I had to fix for rubocop, will remove all of that in a separate pr since it is now removed from katello.

What are the testing steps for this pull request?

  • Try changing a content over ride on a host subscription hammer host subscription content-override --override-name food --value disable --content-label test --host-id 3
  • Apply PR
  • Try the same command see that it prompts you for the --force flag
  • Try with --force and it should go through
  • Same with hammer activation-key content-override --override-name food --value disable --content-label test --id 1 I am not sure how content labels work for activation keys since I get Content label(s) "test" were not found in the Organization "Default Organization" but the pr still works to require the user to pass in --force

We only support enabled as a value on content overrides, adding a flag that makes the user add --force for anything other than enabled.
Increased the line length to 150 from discussions with Quinn on my last PR since Katello is at 200.
lib/hammer_cli_katello/content_override.rb Show resolved Hide resolved
assert_cmd(expected_result, result)
end

it "attaches a content label with value other than enabled without --force" do
Copy link
Member

Choose a reason for hiding this comment

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

No it doesn't.

Suggested change
it "attaches a content label with value other than enabled without --force" do
it "does not attach a content label with value other than enabled without --force" do

Copy link
Member

Choose a reason for hiding this comment

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

nit: All the times it says "attach a content label" in this file, we actually mean "attach a content override."

@chris1984
Copy link
Member Author

Can't reopen pr thanks GH for closing it 😠 #977 is the new one

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.

2 participants