Description of problem: overriding to enabled/disabled in hammer doesn't work. Though hammer content-overide command finishes successfully, it has no effect when using AK while overriding in UI has. Version-Release number of selected component (if applicable): satellite-6.3.0-17.0.beta.el7sat.noarch katello-3.4.5-1.el7sat.noarch foreman-1.15.3-2.el7sat.noarch How reproducible: 100% Steps to Reproduce: 1. Create the AK # hammer activation-key create --name AK --lifecycle-environment-id 1 --content-view-id 1 --organization-id 1 2. Create product with a repository # hammer product create --name Product --organization-id 1 # hammer repository create --name Repo --url "http://some.useful.repo/x86_64/os/" --content-type yum --product Product --organization-id 1 # hammer product synchronize --name Product --organization-id 1 3. Assign the product to the AK sub_id=$(hammer --csv subscription list --organization-id 1 | awk -F, '$3=="Product"{print$1}') hammer activation-key add-subscription --name AK --organization-id 1 --subscription-id $sub_id 4. Override custom content in AK to disabled (since the default is enabled) # hammer activation-key content-override --name AK --organization-id 1 --content-label Default_Organization_Product_Repo --value 0 Updated content override # hammer activation-key product-content --name AK --organization-id 1 --------------|------|------|-----|---------|-----------------------------------|----------|--------- ID | NAME | TYPE | URL | GPG KEY | LABEL | ENABLED? | OVERRIDE --------------|------|------|-----|---------|-----------------------------------|----------|--------- 1504093523357 | Repo | | | | Default_Organization_Product_Repo | yes | ak:0 --------------|------|------|-----|---------|-----------------------------------|----------|--------- >>> UI check says "Enabled" (no effect?) 5. @client: Register using AK # subscription-manager register --activationkey AK --org Default_Organization The system has been registered with ID: a2adfb49-722b-46d1-8a88-59822f4ac29e Installed Product Current Status: Product Name: Red Hat Enterprise Linux Server Status: Not Subscribed Unable to find available subscriptions for all your installed products. 6. Check repos available # yum repolist Loaded plugins: product-id, search-disabled-repos, subscription-manager repo id repo name status !Default_Organization_Product_Repo Repo 304 repolist: 304 >>> BAD repo is not disabled (it has really no effect) Actual results: content-override done by hammer has no effect Expected results: content-override done by hammer works
This is regression as in 6.2 this worked/works. hammer activation-key content-override only sets an override "ak:0/1" but doesn't enable such override or put into effect "enabled:0/1" (while UI override does both) CLI (override done by hammer - bullet 4 in comment#0): # hammer activation-key product-content --name AK --organization-id 1 --------------|------|------|-----|---------|-----------------------------------|----------|--------- ID | NAME | TYPE | URL | GPG KEY | LABEL | ENABLED? | OVERRIDE --------------|------|------|-----|---------|-----------------------------------|----------|--------- 1504093523357 | Repo | | | | Default_Organization_Product_Repo | yes | ak:0 --------------|------|------|-----|---------|-----------------------------------|----------|--------- vs. UI (override done in webui): # hammer activation-key product-content --name AK --organization-id 1 --------------|------|------|-----|---------|-----------------------------------|----------|---------------- ID | NAME | TYPE | URL | GPG KEY | LABEL | ENABLED? | OVERRIDE --------------|------|------|-----|---------|-----------------------------------|----------|---------------- 1505758907338 | Repo | | | | Default_Organization_Product_Repo | yes | ak:0, enabled:0 --------------|------|------|-----|---------|-----------------------------------|----------|---------------- >>> an override done by hammer is incomplete (enabled:0/1 is missing) so such override is not put into effect
UI override from comment#2 should be "enabled:0" instead of "ak:0, enabled:0" - mix of CLI+UI overrides --------------|------|------|-----|---------|-----------------------------------|----------|---------- ID | NAME | TYPE | URL | GPG KEY | LABEL | ENABLED? | OVERRIDE --------------|------|------|-----|---------|-----------------------------------|----------|---------- 1505758907338 | Repo | | | | Default_Organization_Product_Repo | yes | enabled:0 --------------|------|------|-----|---------|-----------------------------------|----------|---------- >>> so hammer sets "ak:0/1" (name in lowercease) vs. webui sets "enabled:0/1" which really works !!!
Created redmine issue http://projects.theforeman.org/issues/21275 from this bug
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/21275 has been resolved.
VERIFIED. @satellite-6.3.0-22.0.el7sat.noarch tfm-rubygem-hammer_cli_katello-0.11.3.4-1.el7sat.noarch by the manual reproducer described in comment#0: 4. Override custom content in AK to disabled (since the default is enabled) # hammer activation-key content-override --name AK --organization-id 1 --content-label Default_Organization_Product_Repo --value 0 Updated content override # hammer activation-key product-content --name AK --organization-id 1 --------------|------|------|-----|---------|-----------------------------------|------------------|---------- ID | NAME | TYPE | URL | GPG KEY | LABEL | DEFAULT ENABLED? | OVERRIDE --------------|------|------|-----|---------|-----------------------------------|------------------|---------- 1513070931633 | Repo | | | | Default_Organization_Product_Repo | yes | enabled:0 --------------|------|------|-----|---------|-----------------------------------|------------------|---------- >>> UI says correctly "Disabled (overridden)" 5. @client: Register using AK # subscription-manager register --activationkey AK --org Default_Organization The system has been registered with ID: 28767822-ac2a-4615-ac49-2e5fa24a1e4f Installed Product Current Status: Product Name: Red Hat Enterprise Linux Server Status: Not Subscribed Unable to find available subscriptions for all your installed products. 6. Check repos available # subscription-manager repos --list +----------------------------------------------------------+ Available Repositories in /etc/yum.repos.d/redhat.repo +----------------------------------------------------------+ Repo ID: Default_Organization_Product_Repo Repo Name: Repo Repo URL: https://<SATFQDN>/pulp/repos/Default_Organization/Library/custom/Product/Repo Enabled: 0 >>> repo is correctly disabled - content-override done by hammer works
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/RHSA-2018:0336