Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1336716 - Unable to remove host collection from activation key via hammer
Summary: Unable to remove host collection from activation key via hammer
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Andrew Kofink
QA Contact: jcallaha
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-17 09:57 UTC by Andrii Balakhtar
Modified: 2021-07-21 14:26 UTC (History)
4 users (show)

Fixed In Version: rubygem-katello-3.0.0.74-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-14 21:00:56 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 15162 0 None None None 2016-05-24 13:06:01 UTC
Red Hat Product Errata RHBA-2016:1885 0 normal SHIPPED_LIVE Satellite 6.2.2 bug fix update 2016-09-15 00:57:56 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:14 UTC
Created attachment 1196925 [details]
Before

Comment 8 jcallaha 2016-09-01 18:58:30 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.