Bug 1336716 - Unable to remove host collection from activation key via hammer
Summary: Unable to remove host collection from activation key via hammer
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hammer
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
Target Milestone: Unspecified
Assignee: Andrew Kofink
QA Contact: jcallaha
URL: http://projects.theforeman.org/issues...
Whiteboard:
Keywords: Triaged
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-17 09:57 UTC by Andrii Balakhtar
Modified: 2019-06-13 21:25 UTC (History)
4 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2016-09-14 21:00:56 UTC


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


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

Description Andrii Balakhtar 2016-05-17 09:57:38 UTC
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 19:05:48 UTC
This is us getting bitten by deep_munge: https://github.com/rails/rails/issues/13420

Comment 3 Andrew Kofink 2016-05-24 12:53:05 UTC
Created redmine issue http://projects.theforeman.org/issues/15162 from this bug

Comment 5 Bryan Kearney 2016-06-02 22:16:23 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/15162 has been closed

Comment 6 jcallaha 2016-09-01 18:57:37 UTC
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 18:58 UTC
Created attachment 1196925 [details]
Before

Comment 8 jcallaha 2016-09-01 18:58 UTC
Created attachment 1196926 [details]
After

Comment 10 errata-xmlrpc 2016-09-14 21:00:56 UTC
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.