Project

General

Profile

Actions

Bug #27595

closed

Get wrong prompts when create virt-who-config missing argments via hammer CLI

Added by Oleh Fedorenko over 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Category:
Other commands
Target version:
-
Fixed in Releases:
Found in Releases:
In Kanboard:

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:

  1. 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:
[ ~]# 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:

[ ~]# 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:

[ ~]# 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.

Actions #1

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.

Actions #2

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
Actions #3

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
Actions #4

Updated by The Foreman Bot about 5 years ago

  • Pull request https://github.com/theforeman/hammer-cli-foreman/pull/443 added
Actions #5

Updated by Martin Bacovsky about 5 years ago

  • Team Backlog Hammer added
Actions #6

Updated by The Foreman Bot about 5 years ago

  • Fixed in Releases hammer-cli-0.20.0 added
Actions #7

Updated by Oleh Fedorenko about 5 years ago

  • Status changed from Ready For Testing to Closed
Actions #8

Updated by Martin Bacovsky about 5 years ago

  • Status changed from Closed to Ready For Testing
Actions #9

Updated by Oleh Fedorenko about 5 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF