Bug 1813624 - Consistent use of unlimited-host argument throughout CLI
Summary: Consistent use of unlimited-host argument throughout CLI
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Activation Keys
Version: 6.6.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.11.0
Assignee: Jeremy Lenz
QA Contact: Cole Higgins
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-14 21:50 UTC by Paul Armstrong
Modified: 2022-07-05 14:28 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-07-05 14:27:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 32868 0 Normal New Consistent use of unlimited-host argument throughout CLI' 2021-06-23 19:08:13 UTC
Red Hat Product Errata RHSA-2022:5498 0 None None None 2022-07-05 14:28:14 UTC

Description Paul Armstrong 2020-03-14 21:50:25 UTC
Description of problem:
common argument used in hammer commands --unlimited-hosts in some cases requires a value in other cases it is passed without a value. We should be consistent across the CLI. 

Allow the user to pass 1|0 true|false yes|no AND insist on a value 
OR 
Allow the user to pass without a value
OR
Allow the user to do either 

NOT have a mix of requirements


Version-Release number of selected component (if applicable):
[root@sat6 ~]# hammer --version
hammer (0.17.1)
 * hammer_cli_foreman (0.17.0.8)
 * hammer_cli_foreman_admin (0.0.8)
 * hammer_cli_foreman_ansible (0.3.2)
 * hammer_cli_foreman_bootdisk (0.1.3.3)
 * hammer_cli_foreman_discovery (1.0.1)
 * hammer_cli_foreman_docker (unknown version)
 * hammer_cli_foreman_openscap (0.1.7)
 * hammer_cli_foreman_remote_execution (unknown version)
 * hammer_cli_foreman_tasks (unknown version)
 * hammer_cli_foreman_templates (0.1.2)
 * hammer_cli_foreman_virt_who_configure (unknown version)
 * hammer_cli_katello (0.18.0.6)


How reproducible: 
always


Steps to Reproduce:
1. run two commands  
2. hammer host-collection create <args> --unlimited-hosts
3. hammer activation-key create <args> --unlimited-hosts

Actual results:
hammer host-collection create generates an error **unless** you pass true|false 1|0 yes|no

hammer activation-key create generates an error ** if ** you pass true|false 1|0 yes|no


Expected results:
both commands should have the same behaviour for a similar argument and meaning.


Additional info:
my vote is to be ansible-ish and allow the user either pass a value or not and default true yes 1 if a value is not provided. My $0.02CAD

Comment 4 Jeremy Lenz 2021-06-23 19:08:12 UTC
Created redmine issue https://projects.theforeman.org/issues/32868 from this bug

Comment 5 Bryan Kearney 2021-06-23 20:01:02 UTC
Upstream bug assigned to jlenz

Comment 6 Bryan Kearney 2021-06-23 20:01:05 UTC
Upstream bug assigned to jlenz

Comment 7 Bryan Kearney 2021-06-25 00:01:08 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/32868 has been resolved.

Comment 8 Mike McCune 2021-07-09 17:02:24 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this feel free to contact your Red Hat Account Team. Thank you.

Comment 9 Jeremy Lenz 2021-07-09 17:25:40 UTC
we actually did decide to fix this, moving back to POST

Comment 10 Stephen Wadeley 2022-05-11 07:42:35 UTC
Hi Jeremy

Re this suggestion:


> 
> Additional info:
> my vote is to be ansible-ish and allow the user either pass a value or not
> and default true yes 1 if a value is not provided. My $0.02CAD

that sounds good to me, but what is the default behaviour for most flags at the moment?

see also:
Bug 2082241 - hammer host-collection create fails with "Too many arguments" when setting unlimited-hosts

Comment 11 Jeremy Lenz 2022-05-11 13:48:24 UTC
I think @paji will be more qualified to answer this..

Partha, recall the discussion at https://github.com/Katello/hammer-cli-katello/pull/809

It seemed like a good solution to me. But you're more familiar with hammer and consistency of different commands..

Comment 12 Partha Aji 2022-05-11 15:36:25 UTC
Stephen,
Ideally all the boolean values in the API Doc translate to flags. For example `--composite` or `--import-only` in content views. Unfortunately its not consistent across the board. But as Jeremy mentioned I 'd argue `--unlimited-hosts` as  a flag is consistent with what `hammer activation-key create --unlimited-hosts`.

Comment 16 errata-xmlrpc 2022-07-05 14:27:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.11 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5498


Note You need to log in before you can comment on or make changes to this bug.