Description of problem: hammer activation key product-content does not filter content based on organization Version-Release number of selected component (if applicable): Sat 6.1 GA Snap 15 How reproducible: Always Steps to Reproduce: 1. Create two Orgs - enable, sync different RH content on both the orgs 2. Create an activation key, attach subscription and navigate to web ui -> select the activation key -> Product Content tab -> See that the enabled/synced repos are displayed there - this works as expected 3. Check the same in hammer cli: hammer> activation-key product-content --id=1 -----|-----------------------------------------------------------|------|-----|---------|------------------------------------------ ID | NAME | TYPE | URL | GPG KEY | LABEL -----|-----------------------------------------------------------|------|-----|---------|------------------------------------------ 2456 | Red Hat Enterprise Linux 7 Server (RPMs) | | | | rhel-7-server-rpms 4362 | Red Hat Satellite Tools 6 Beta (for RHEL 6 Server) (RPMs) | | | | rhel-6-server-satellite-tools-6-beta-rpms 168 | Red Hat Enterprise Linux 6 Server (RPMs) | | | | rhel-6-server-rpms 3455 | MRG Grid (for RHEL 6 Server) (RPMs) | | | | rhel-6-server-mrg-grid-rpms 4362 | Red Hat Satellite Tools 6 Beta (for RHEL 6 Server) (RPMs) | | | | rhel-6-server-satellite-tools-6-beta-rpms 168 | Red Hat Enterprise Linux 6 Server (RPMs) | | | | rhel-6-server-rpms 3455 | MRG Grid (for RHEL 6 Server) (RPMs) | | | | rhel-6-server-mrg-grid-rpms 4362 | Red Hat Satellite Tools 6 Beta (for RHEL 6 Server) (RPMs) | | | | rhel-6-server-satellite-tools-6-beta-rpms -----|-----------------------------------------------------------|------|-----|---------|------------------------------------------ hammer> activation-key product-content --id=1 --organization-id=3 -----|-----------------------------------------------------------|------|-----|---------|------------------------------------------ ID | NAME | TYPE | URL | GPG KEY | LABEL -----|-----------------------------------------------------------|------|-----|---------|------------------------------------------ 2456 | Red Hat Enterprise Linux 7 Server (RPMs) | | | | rhel-7-server-rpms 4362 | Red Hat Satellite Tools 6 Beta (for RHEL 6 Server) (RPMs) | | | | rhel-6-server-satellite-tools-6-beta-rpms 168 | Red Hat Enterprise Linux 6 Server (RPMs) | | | | rhel-6-server-rpms 3455 | MRG Grid (for RHEL 6 Server) (RPMs) | | | | rhel-6-server-mrg-grid-rpms 4362 | Red Hat Satellite Tools 6 Beta (for RHEL 6 Server) (RPMs) | | | | rhel-6-server-satellite-tools-6-beta-rpms 168 | Red Hat Enterprise Linux 6 Server (RPMs) | | | | rhel-6-server-rpms 3455 | MRG Grid (for RHEL 6 Server) (RPMs) | | | | rhel-6-server-mrg-grid-rpms 4362 | Red Hat Satellite Tools 6 Beta (for RHEL 6 Server) (RPMs) | | | | rhel-6-server-satellite-tools-6-beta-rpms -----|-----------------------------------------------------------|------|-----|---------|------------------------------------------ Actual results: Both the hammer commands listed above lists all the enabled/synced repos across all the organizations of this satellite Expected results: Both the above commands should list the enabled/sync repos corresponding to the current organization (selected activation key's organization) only. Additional info:
Created redmine issue http://projects.theforeman.org/issues/14043 from this bug
I have tested this with two organizations, and found that if searched with an activation key it only brings back the product content for that activation key and organization. Since an activation key implicitly belongs to one organization it seems to follow that giving it an organization to filter it with as well seems unnecessary. Please let me know what you think, thanks!
Originally I had tested this issue with non-redhat products. I discovered that after enabling Red Hat Repositories and subscribing them to an activation-key they can provide the same content. This gives the appearance of duplicates showing up in calls for an activation-keys product content. I will fix this issue, and then it should be working as intended.
The issue with duplicate content showing up will no longer occur. As stated before there is no need to filter by organization-id as an Activation-key is unique to an organization. I looked into removing it as an option in hammer but it is used by activation-key product-content --name as a way of knowing which activation-key id to use when making a call to the API. I discussed this with some team mates and we decided that because it is a quirk with Hammer and not Katello the API should not be changed either.
Moving to POST since upstream bug http://projects.theforeman.org/issues/14043 has been closed
Failed in Satellite-6.2-beta-snap-5.1. The activation keys below are from different org and enabled with different manifests, RH repositories. Notice that they are listing the same RH repos. Custom products are filtered correctly per the activation key/org. hammer> activation-key product-content --id=1 --------------|-----------------------------------------------|------|-----|---------|-----------------------------------------------|--------- ID | NAME | TYPE | URL | GPG KEY | LABEL | ENABLED? --------------|-----------------------------------------------|------|-----|---------|-----------------------------------------------|--------- 2455 | Red Hat Enterprise Linux 7 Server (Kickstart) | | | | rhel-7-server-kickstart | 1 2456 | Red Hat Enterprise Linux 7 Server (RPMs) | | | | rhel-7-server-rpms | default 1458779349329 | rhel7sat6tools | | | | Default_Organization_sat6tools_rhel7sat6tools | default --------------|-----------------------------------------------|------|-----|---------|-----------------------------------------------|--------- hammer> activation-key list --or --order --organization --organization-id --organization-label hammer> activation-key list --organization-id=3 ---|-------------|----------------|-----------------------|----------------- ID | NAME | HOST LIMIT | LIFECYCLE ENVIRONMENT | CONTENT VIEW ---|-------------|----------------|-----------------------|----------------- 2 | sthirugn_ak | 0 of Unlimited | Library | test_sthirugn_cv ---|-------------|----------------|-----------------------|----------------- hammer> hammer> activation-key product-content --id=2 --------------|-----------------------------------------------|------|-----|---------|---------------------------------|--------- ID | NAME | TYPE | URL | GPG KEY | LABEL | ENABLED? --------------|-----------------------------------------------|------|-----|---------|---------------------------------|--------- 2455 | Red Hat Enterprise Linux 7 Server (Kickstart) | | | | rhel-7-server-kickstart | default 2456 | Red Hat Enterprise Linux 7 Server (RPMs) | | | | rhel-7-server-rpms | default 1458848295245 | testrepo1 | | | | sthirugn_testproduct1_testrepo1 | default --------------|-----------------------------------------------|------|-----|---------|---------------------------------|---------
I think that I have fixed the problem causing this error and the PR has been merged.
Marking as a blocker+ as this commit fixes bug #1317679, which is a blocker itself. This will assure that both, perhaps subtly different behaviors, are verified. QE NOTES: Test both this bug and bug #1317679 at the same time.
Still broken.
Confirmed fixed
Failed in satellite-6.2.0-6.2.beta.el7sat.noarch due to the following error: hammer> activation-key product-content --id=1 undefined method `map' for nil:NilClass A separate bug is written as well - https://bugzilla.redhat.com/show_bug.cgi?id=1324884
This new part of the bug was fixed last night. https://github.com/Katello/katello/pull/5945
Verified in satellite-6.2.0-7.0.beta.el7sat.noarch hammer> activation-key product-content --id=1 --------------|-----------------------------------------------|------|-----|---- ID | NAME | TYPE | URL | GPG KEY | LABEL | ENABLED? --------------|-----------------------------------------------|------|-----|---- 1460390504117 | sat6toolsrepo | | | | Default_Organization_sat6tools_sat6toolsrepo | default 2455 | Red Hat Enterprise Linux 7 Server (Kickstart) | | | | rhel-7-server-kickstart | 1 2456 | Red Hat Enterprise Linux 7 Server (RPMs) | | | | rhel-7-server-rpms | default hammer> activation-key product-content --id=2 --------------|----------------------------------------------------------------- ID | NAME | TYPE | URL | GPG KEY | LABEL | ENABLED? --------------|----------------------------------------------------------------- 3815 | Red Hat Virt V2V Tool for RHEL 7 (RPMs) | | | | rhel-7-server-v2vwin-1-rpms | default 2386 | Red Hat Virt V2V Tool for RHEL 6 (RPMs) | | | | rhel-6-server-v2vwin-1-rpms | default 4539 | Red Hat OpenStack Tools 7.0 for Red Hat Enterprise Linux 7 Server (RPMs) | | | | rhel-7-server-openstack-7.0-tools-rpms | default 1430 | Red Hat Subscription Asset Manager (for RHEL 6 Server) (RPMs) | | | | rhel-6-server-sam-rpms | default 1460476153103 | testorg_customproduct_customrepo | | | | testorg_testorg_customproduct_testorg_customproduct_customrepo | default
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:1501