Bug #15458
closed[6.2 Beta] Adding a host collection to activation key using --host-collection option with hammer fails
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1335783
Description of problem:
-----------------------
Adding a host collection to activation key using --host-collection option with hammer fails
Version-Release number of selected component (if applicable):
-----------------------
Satellite 6.2 Beta
How reproducible:
-----------------------
Always.
Steps to Reproduce:
------------------------
Satellite 6.2 Beta installed on RHEL 7.2 server.
1.
List all available host collection with ID and name.
- hammer organization list
---|----------------------|----------------------|------------
ID | NAME | LABEL | DESCRIPTION
---|----------------------|----------------------|------------
1 | Default Organization | Default_Organization |
---|----------------------|----------------------|------------
- hammer host-collection list --organization-id 1
---|---------------|-------|------------
ID | NAME | LIMIT | DESCRIPTION
---|---------------|-------|------------
2 | ESS Dev Hosts | None |
---|---------------|-------|------------
~~~
- hammer activation-key add-host-collection --name 'ESS_RHEL7_Dev_Hosts' --host-collection-id 2 --organization-id 1
The host collection has been associated
~~~
Using host collection ID I was able to assign a host collection to the activation key.
3. Trying to add host collection using host-collection name -~~~
- hammer activation-key add-host-collection --name "ESS_RHEL7_Dev_Hosts" --host-collection "ESS Dev Hosts" --organization-id 1
Could not add host collection:
undefined method `id' for nil:NilClass
~~~
Actual results:
-----------------------
Fails with error "Could not add host collection: undefined method `id' for nil:NilClass "
Expected results:
-----------------------
Should add host-collection to the activation key.
Additional info:
-----------------------