Project

General

Profile

Bug #27595

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

Added by Oleh Fedorenko 10 months ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Category:
Other commands
Target version:
-
Team Backlog:
Hammer
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.

Associated revisions

Revision d08b6730 (diff)
Added by Oleh Fedorenko 9 months ago

Refs #27595 - Better prompts for missing arguments

Revision 486e8f15 (diff)
Added by Oleh Fedorenko 7 months ago

Fixes #27595 - Better prompts for missing arguments (#313)

Revision 7881eb6d
Added by Shira Maximov 7 months ago

Merge pull request #443 from ofedoren/bug-27595-wrong-prompts-for-missing-args

Refs #27595 - Better prompts for missing arguments

History

#1 Updated by Oleh Fedorenko 10 months 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.

#2 Updated by Oleh Fedorenko 9 months ago

  • Triaged changed from No to Yes
  • Assignee set to Oleh Fedorenko
  • Status changed from New to Assigned

#3 Updated by The Foreman Bot 9 months ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/hammer-cli/pull/313 added

#4 Updated by The Foreman Bot 9 months ago

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

#5 Updated by Martin Bacovsky 8 months ago

  • Team Backlog Hammer added

#6 Updated by The Foreman Bot 7 months ago

  • Fixed in Releases hammer-cli-0.20.0 added

#7 Updated by Oleh Fedorenko 7 months ago

  • Status changed from Ready For Testing to Closed

#8 Updated by Martin Bacovsky 7 months ago

  • Status changed from Closed to Ready For Testing

#9 Updated by Oleh Fedorenko 7 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF