Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1336716 - Unable to remove host collection from activation key via hammer
Unable to remove host collection from activation key via hammer
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hammer (Show other bugs)
6.2.0
Unspecified Unspecified
unspecified Severity medium (vote)
: 6.2.2
: Unused
Assigned To: Andrew Kofink
jcallaha
http://projects.theforeman.org/issues...
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-05-17 05:57 EDT by Andrii Balakhtar
Modified: 2016-09-19 21:55 EDT (History)
4 users (show)

See Also:
Fixed In Version: rubygem-katello-3.0.0.74-1
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-09-14 17:00:56 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Before (87.05 KB, image/png)
2016-09-01 14:58 EDT, jcallaha
no flags Details
After (83.27 KB, image/png)
2016-09-01 14:58 EDT, jcallaha
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 15162 None None None 2016-05-24 09:06 EDT
Red Hat Product Errata RHBA-2016:1885 normal SHIPPED_LIVE Satellite 6.2.2 bug fix update 2016-09-14 20:57:56 EDT

  None (edit)
Description Andrii Balakhtar 2016-05-17 05:57:38 EDT
Description of problem:
Can't remove host collection from activation key using hammer - operation succeeds but host collection remains associated.

Version-Release number of selected component (if applicable):
Sat 6.2.0 GA SNAP11

How reproducible:
Always

Steps to Reproduce:
1. Associate host collection with activation key.
2. Try to remove host collection from activation key via 'hammer activation-key remove-host-collection' command.
3. Check whether host collection was actually removed.

Actual results:
remove-host-collection command succeeds, but host collection remains associated:

2016-05-17 12:33:07 - robottelo.ssh - DEBUG - >>> [dell-t320-01.khw.lab.eng.bos.redhat.com] LANG=en_US.UTF-8  hammer -v -u admin -p changeme  activation-key remove-host-collection --host-collection-id="1" --name="v6ncdpkpdL" --organization="X25dny"
2016-05-17 12:33:13 - robottelo.ssh - DEBUG - <<< stdout
The host collection has been removed

2016-05-17 12:33:13 - robottelo.ssh - DEBUG - >>> [dell-t320-01.khw.lab.eng.bos.redhat.com] LANG=en_US.UTF-8  hammer -v -u admin -p changeme  activation-key info --id="1"
2016-05-17 12:33:18 - robottelo.ssh - DEBUG - <<< stdout
Name:                  v6ncdpkpdL
ID:                    1
Description:           
Host Limit:            Unlimited
Auto Attach:           true
Lifecycle Environment: 
Content View:          
Host Collections:      
 1) ID:   1
    Name: FMpDVYKxmh


Expected results:
Host collection should be removed from activation key.
Also some validation for `activation-key remove-host-collection` command should be present - it shouldn't say 'The host collection has been removed' and finish with 0 return code when operation's failed.

Additional info:
Works as expected via UI (and, basically, 'activation-key info' reflects the changes, so it's an issue with `activation-key remove-host-collection`, not `activation-key info` command)
Comment 2 Andrew Kofink 2016-05-20 15:05:48 EDT
This is us getting bitten by deep_munge: https://github.com/rails/rails/issues/13420
Comment 3 Andrew Kofink 2016-05-24 08:53:05 EDT
Created redmine issue http://projects.theforeman.org/issues/15162 from this bug
Comment 5 Bryan Kearney 2016-06-02 18:16:23 EDT
Moving to POST since upstream bug http://projects.theforeman.org/issues/15162 has been closed
Comment 6 jcallaha 2016-09-01 14:57:37 EDT
Verified in Satellite 6.2.2. See attached screenshots and the commands below.

[root@rhsm-qe-1 tmp]# hammer activation-key remove-host-collection --help
Usage:
    hammer activation-key remove-host-collection [OPTIONS]

Options:
 --host-collection HOST_COLLECTION_NAME                            Host collection name to search by
 --host-collection-id HOST_COLLECTION_ID                           Id of the host collection
 --host-collection-organization-id HOST_COLLECTION_ORGANIZATION_ID Organization ID to search by
 --id ID                                                           ID of the activation key
 --name NAME                                                       Activation key name to search by
 --organization ORGANIZATION_NAME                                  Organization name to search by
 --organization-id ORGANIZATION_ID                                 organization ID
 --organization-label ORGANIZATION_LABEL                           Organization label to search by
 -h, --help                                                        print help

[root@rhsm-qe-1 tmp]# hammer activation-key list --organization-id 1
---|--------|----------------|-----------------------|--------------------------
ID | NAME   | HOST LIMIT     | LIFECYCLE ENVIRONMENT | CONTENT VIEW             
---|--------|----------------|-----------------------|--------------------------
1  | 7tools | 0 of Unlimited | Library               | Default Organization View
---|--------|----------------|-----------------------|--------------------------

[root@rhsm-qe-1 tmp]# hammer -u admin -p changeme host-collection list --organization-id 1
---|--------|-------|------------
ID | NAME   | LIMIT | DESCRIPTION
---|--------|-------|------------
1  | docker | None  |            
---|--------|-------|------------

[root@rhsm-qe-1 tmp]# hammer activation-key remove-host-collection --host-collection-id 1 --id 1 --organization-id 1
The host collection has been removed
Comment 7 jcallaha 2016-09-01 14:58 EDT
Created attachment 1196925 [details]
Before
Comment 8 jcallaha 2016-09-01 14:58 EDT
Created attachment 1196926 [details]
After
Comment 10 errata-xmlrpc 2016-09-14 17:00:56 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1885

Note You need to log in before you can comment on or make changes to this bug.