Description of problem: hammer hostgroup create/update --compute-resource fails to query CR since it uses wrong api call for the query: GET /api/compute_resources Params: { "name" => "libvirt" } This call basically returns all compute resources: Could not create the hostgroup: Error: Found more than one compute_resource. Version-Release number of selected component (if applicable): 6.4.0 (Snap16) How reproducible: deterministic Steps to Reproduce: 1. Have more than 1 CR # hammer compute-resource list ---|---------------|--------- ID | NAME | PROVIDER ---|---------------|--------- 1 | docker | Docker 2 | libvirt | Libvirt ---|---------------|--------- 2. Try to create/update a hostgroup querying CR by name # hammer hostgroup create --name 'libvirt hosts' --compute-resource libvirt Could not create the hostgroup: Error: Found more than one compute_resource. Actual results: fails to create/update HG when referring CR by name (by id works) Expected results: successful HG creation/update when referring CR also by name
When referring to compute profile by name it also uses wrong api call listing all 3 compute profiles: # hammer hostgroup create --name 'libvirt hosts' --compute-resource-id 2 --compute-profile 1-Small Could not create the hostgroup: Error: Found more than one compute_profile. ... [ INFO 2018-08-09T10:05:47 API] GET /api/compute_profiles [DEBUG 2018-08-09T10:05:47 API] Params: { "name" => "1-Small" } [DEBUG 2018-08-09T10:05:47 API] Headers: { :params => { "name" => "1-Small" } } [DEBUG 2018-08-09T10:05:47 API] Using authenticator: HammerCLIForeman::Api::InteractiveBasicAuth [DEBUG 2018-08-09T10:05:48 API] Response: { "total" => 3, ...
Hi Lukas, Do you know if this is a regression from 6.3? (Thanks!)
With --compute-resource option it can't be regression since the option doesn't exist on 6.3 With --compute-profile option I tested it is broken the same way on 6.3, so no regression too.
*** This bug has been marked as a duplicate of bug 1584785 ***