Bug #19048

hammer host create doesnt work with --hostgroup-title

Added by Tomáš Strachota about 1 year ago. Updated 10 months ago.

Assigned To:Tomáš Strachota
Target version:Foreman - Team Marek Iteration 13
Difficulty: Bugzilla link:1436162
Found in release: Pull request:https://github.com/theforeman/hammer-cli-foreman/pull/294
Story points-
Velocity based estimate-
Releasehammer-cli-foreman-0.11.0Release relationshipAuto


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

Description of problem:
hammer host create doesnt work with --hostgroup-title

Steps to Reproduce:
1. create 2 nested host groups with the lowest hostgroub being non-unique
2. try to create a host with the hammer command using --hostgroup-title and not --hostgroup

Actual results:
Command fials

Expected results:
Host created

Additional info:
We use nested hostgroups and one of the layers of nesting is the DC name (p1 or p2). We have created hostgroups under these 2 locations that represent our lifecycle environments - dit100 sit100 etc.



As the hostgroup name (dit100) is not unique, we cant use --hostgroup with hammer host create as it finds more than one hostgroup that matches.

We were happy to see that we could use --hostgroup-title as these ARE unique but the command fails

hammer host create --name tdi-tst242  --hostgroup-title "hg-rhel6-base/p1/dit100-p1"  --ip --compute-resource 'VMware DC1'  --compute-profile 1-Small --location P1 --organization TLG
Could not create the host:
  Error: Options --environment-id, --architecture-id, --domain-id, --puppet-proxy-id, --operatingsystem-id, --partition-table-id are required

  See: 'hammer host create --help'

As a work around we have added the DC name to each hostgorup to make it unique but this means duplicating info in the name

hammer host create --name tdi-tst242-p1  --hostgroup dit100-p1  --ip --compute-resource 'VMware DC1'  --compute-profile 1-Small --location P1 --organization TLG
Host created

Associated revisions

Revision 8d79daca
Added by Tomas Strachota about 1 year ago

Fixes #19048 - accept hostgroup title in host create


#1 Updated by Tomáš Strachota about 1 year ago

  • Subject changed from hammer host create doesnt work with --hostgroup-title to hammer host create doesnt work with --hostgroup-title
  • Category changed from Other commands to Hosts
  • Assigned To set to Tomáš Strachota
  • Target version set to Team Marek Iteration 12

#2 Updated by The Foreman Bot about 1 year ago

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

#3 Updated by Marek Hulán about 1 year ago

  • Target version changed from Team Marek Iteration 12 to Team Marek Iteration 13

#4 Updated by Anonymous about 1 year ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#5 Updated by Tomáš Strachota 10 months ago

  • Release set to hammer-cli-foreman-0.11.0

Also available in: Atom PDF