Bug #14333

hammer activation-key --unlimited-content-hosts flag is confusing

Added by Zach Huntington-Meath over 3 years ago. Updated about 1 year ago.

Target version:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:


Cloned from
Description of problem:
unlimited-hosts flag is not required by `hammer activation-key create` as there's no limit set by default if no --max-content-hosts is used.

the `hammer activation-key update` on the other hand uses `--unlimited-content-hosts` flag for changing the limit to `unlimited`. However, this flag requires a boolean value (true/false, yes/no, 1/0). So we can have an AK with unlimited content hosts and update it using `--unlimited-content-hosts true`. The other way around - setting it back to limited, requires `--max-content-hosts` no matter what:

  1. hammer -u admin -p changeme activation-key update --unlimited-content-hosts false --id 78 --organization-id 3

Could not update the activation key:
Validation failed: Max content hosts cannot be nil

making the use of `hammer activation-key update --unlimited-content-hosts false` useless as the same effect is being done using `--max-content-hosts` option only.

I believe we can drop `--unlimited-content-hosts` option from `create` subcommand
and change the behaviour of the same option in `update` subcommand not to accept any bool valie (only check for falg presence).

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. hammer activation-key create --unlimited-content-hosts --organization-id 1 --name foo
2. hammer activation-key create --organization-id 1 --name bar
3. compare the content host limit of both activation keys

  1. for the `update` subcommand:
    4. create AK with no content host limit
    5. hammer activation key update --organization-id 1 --id 70 --unlimited-content-hosts false

Actual results:
as described above

Expected results:
no `--unlimited-content-host` option `create` subcommand,
make the same flag in `update` subcommand not to require any boolean value (presence-based check only)

Additional info:
snap 2.1

Associated revisions

Revision fb494a72 (diff)
Added by Zach Huntington-Meath over 3 years ago

Fixes #14333 - Makes --unlimited-hosts a flag for update on an activation key.

Revision c527eb11
Added by Brad Buckingham about 3 years ago

Merge pull request #370 from zjhuntin/rename_activation_key_attributes

Fixes #14333 - Makes --unlimited-hosts a flag for update on an activation key.


#1 Updated by Zach Huntington-Meath over 3 years ago

  • Assignee set to Zach Huntington-Meath

#2 Updated by Eric Helms over 3 years ago

  • Legacy Backlogs Release (now unused) set to 143

#3 Updated by The Foreman Bot over 3 years ago

  • Status changed from New to Ready For Testing
  • Pull request added

#4 Updated by Zach Huntington-Meath about 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF