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 #32868 - Make --unlimited-hosts a flag so it doesn't require a value #809

Merged
merged 3 commits into from Jun 24, 2021

Conversation

jeremylenz
Copy link
Member

@jeremylenz jeremylenz commented Jun 23, 2021

Previously:

hammer activation-key create:

  • takes unlimited-hosts argument
  • errors if you pass a value such as --unlimited-hosts=yes
  • Behaves correctly.

hammer host-collection create:

  • takes unlimited-hosts argument
  • errors if you do NOT pass a value
  • Behaves incorrectly.

With this patch, hammer host-collection create now takes --unlimited-hosts as a flag rather than a parameter, meaning that it behaves the same way as hammer activation-key create. Thus, hammer's behavior is more consistent.

@theforeman-bot
Copy link

Issues: #32868

@jeremylenz
Copy link
Member Author

behavior before patch:

[vagrant@centos7-katello-devel hammer-cli-katello]$ hammer host-collection create --unlimited-hosts
Could not create the host collection:
  Error: Option '--unlimited-hosts': Value must be one of true/false, yes/no, 1/0..
  
  See: 'hammer host-collection create --help'.
[vagrant@centos7-katello-devel hammer-cli-katello]$ hammer activation-key create --unlimited-hosts=yes
Could not create the activation key:
  Error: Too many arguments.
  
  See: 'hammer activation-key create --help'.

@parthaa
Copy link
Contributor

parthaa commented Jun 24, 2021

Mostly works well other than that one comment

@jeremylenz
Copy link
Member Author

@parthaa committed your suggestion. It's on the dev box I had to destroy, so I didn't test it. But based on the same code in activation_keys I think it's fine :)

@parthaa
Copy link
Contributor

parthaa commented Jun 24, 2021

@parthaa committed your suggestion. It's on the dev box I had to destroy, so I didn't test it. But based on the same code in activation_keys I think it's fine :)

works well

$ hammer  host-collection create --organization-id=1 --unlimited-hosts --name=great3 --max-hosts=1
Could not create the host collection:
  Error: You can't set all options --unlimited-hosts, --max-hosts at one time.
  
  See: 'hammer host-collection create --help'.

@jlsherrill jlsherrill merged commit 35deb71 into Katello:master Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants