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.