Bug #27595
closedGet wrong prompts when create virt-who-config missing argments via hammer CLI
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1737879
Description of problem:
Get wrong prompts when create virt-who-config missing argments via hammer CLI.
Steps to Reproduce:
1. Use hammer CLI to create virt-who-config, not set hypervisor username:
- hammer virt-who-config create --name example --interval 60 --hypervisor-type libvirt --hypervisor-server XXX.XXX.XXX.XXX --filtering-mode none --hypervisor-id hostname --satellite-url satellite.example.com --organization-id 1
2. Check result:
[vagrant@foreman.example.com ~]# hammer virt-who-config create --name example --interval 60 --hypervisor-type libvirt --hypervisor-server XXX.XXX.XXX.XXX --filtering-mode none --hypervisor-id hostname --satellite-url satellite.example.com --organization-id 1
Could not create the Virt Who configuration:
Missing arguments for 'foreman_virt_who_configure_config[hypervisor_username]'
3. Add hypervisor_username according to prompts(as abouve), check the results again:
[vagrant@foreman.example.com ~]# hammer virt-who-config create --name example --interval 60 --hypervisor-type libvirt --hypervisor-server XXX.XXX.XXX.XXX --filtering-mode none --hypervisor-id hostname --satellite-url satellite.example.com --organization-id 1 --hypervisor_username libvirt
Actual results:
Could not create the Virt Who configuration:
Error: Unrecognised option '--hypervisor_username'.
See: 'hammer virt-who-config create --help'.
Expected results:
The prompts should point out missing --hypervisor-username, not hypervisor_username, it may cause the user confused.
The same with hypervisor-type, hypervisor-id, hypervisor-server, hypervisor-username and satellite-url.
Additional info:
The prompts of missing org_id can be a good example:
[vagrant@foreman.example.com ~]# hammer virt-who-config create --name example --interval 60 --hypervisor-type libvirt --hypervisor-username root --hypervisor-server XXX.XXX.XXX.XXX --filtering-mode none --satellite-url satellite.example.com
Could not create the Virt Who configuration:
Error: Could not find organization, please set one of options --organization, --organization-title, --organization-id.
Updated by Oleh Fedorenko over 5 years ago
- Subject changed from Get wrong prompts when create virt-who-config missing argments via hammer CLI to Get wrong prompts when create virt-who-config missing argments via hammer CLI
The issue says it's a problem with virt-who plugin, but I'd say that a similar issue could happen with any hammer plugin. We should update the way we show those errors in core or hammer-cli-foreman to be more general as was in additional info said.
Updated by Oleh Fedorenko about 5 years ago
- Status changed from New to Assigned
- Assignee set to Oleh Fedorenko
- Triaged changed from No to Yes
Updated by The Foreman Bot about 5 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/hammer-cli/pull/313 added
Updated by The Foreman Bot about 5 years ago
- Pull request https://github.com/theforeman/hammer-cli-foreman/pull/443 added
Updated by The Foreman Bot about 5 years ago
- Fixed in Releases hammer-cli-0.20.0 added
Updated by Oleh Fedorenko about 5 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset 486e8f15b208e433a91717f4fdfd1904551e8e4d.
Updated by Martin Bacovsky about 5 years ago
- Status changed from Closed to Ready For Testing
Updated by Oleh Fedorenko about 5 years ago
- Status changed from Ready For Testing to Closed