Project

General

Profile

Actions

Bug #32878

closed

Parent Hostgroup hammer parameter accept only name, not title

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

Status:
Closed
Priority:
High
Category:
Other commands
Target version:
-
Difficulty:
Triaged:
No
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1807536

Description of problem: While creating hostgroup through hammer getting error:
~~
Could not create the hostgroup:
Error: hostgroup not found.
~~

Creating the child hostgroup through WEB UI works as it gives the option to select the complete Parent hostgroup path. However from hammer we cannot select the complete Parent hostgroup path.

For example:
~~
[root@sat ~]# hammer hostgroup create --organization RedHat --name 20c --parent new1/latest/abcd
Could not create the hostgroup:
Error: hostgroup not found.
~~

While, we can create a child hostgroup by only mentioning abcd:
~~
[root@sat ~]# hammer hostgroup create --organization RedHat --name 20c --parent abcd
~~

This becomes a problem if we have multiple parent hostgroup paths with same names. For example:
- new1/latest/abcd
- new1/abcd
- new2/latest

In the above scenario, we can easily create child hostgroup from WEB UI as it suggests the complete hostgroup paths in "Parent Hostgroup" option. On the other hand, it is impossible to use the same using hammer as the same name is used in multiple paths.

Version-Release number of selected component (if applicable): 6.7 beta

How reproducible: Everytime

Steps to Reproduce:
1. The hostgroup can be created by mentioning sinagle name
  1. hammer hostgroup create --organization RedHat --name 20c --parent abcd
2. If you mention the complete path then it fails:
  1. hammer hostgroup create --organization RedHat --name 20c --parent new1/latest/abcd
    Could not create the hostgroup:
    Error: hostgroup not found.

Actual results: For creating child hostgroups using hammer we cannot specify the complete parent hostgroup path

Expected results: hammer should allow to use complete parent hostgroup path just like the Satellite web UI

Additional info:

Actions #1

Updated by Oleh Fedorenko about 3 years ago

  • Status changed from New to Assigned
  • Assignee set to Oleh Fedorenko
Actions #2

Updated by The Foreman Bot about 3 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/hammer-cli-foreman/pull/579 added
Actions #3

Updated by The Foreman Bot about 3 years ago

  • Fixed in Releases hammer-cli-foreman-3.1.0 added
Actions #4

Updated by Oleh Fedorenko about 3 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF