Project

General

Profile

Actions

Bug #27221

closed

Cannot override activation key repository-sets status using hammer

Added by Matthew Smith almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Hammer
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

When I try to override any activation key's repository set status to enable or disable using hammer cli there is no change even though there is a message to suggest the update was successful.

Using Katello 3.12 on CentOS 7.6

[root@katello ~]# hammer activation-key product-content --name test --organization-id 1
---|--------------------------------|--------------------------------------------------|------------------|---------
ID | NAME | LABEL | DEFAULT ENABLED? | OVERRIDE
---|--------------------------------|--------------------------------------------------|------------------|---------
2 | CentOS 7.6.1810 Extras | MNSMITHUK_CentOS_CentOS_7_6_1810_Extras | yes |
1 | CentOS 7.6.1810 OS | MNSMITHUK_CentOS_CentOS_7_6_1810_OS | yes |
3 | CentOS 7.6.1810 Updates | MNSMITHUK_CentOS_CentOS_7_6_1810_Updates | yes |
4 | EPEL 7 | MNSMITHUK_EPEL_EPEL_7 | yes |
8 | Foreman 1.22 Client EL7 | MNSMITHUK_Foreman_Foreman_1_22_Client_EL7 | yes |
7 | Foreman 1.22 EL7 | MNSMITHUK_Foreman_Foreman_1_22_EL7 | yes |
9 | Foreman 1.22 Plugins EL7 | MNSMITHUK_Foreman_Foreman_1_22_Plugins_EL7 | yes |
5 | Puppet 5 EL7 | MNSMITHUK_Puppet_Puppet_5_EL7 | yes |
6 | Puppet 5 EL8 | MNSMITHUK_Puppet_Puppet_5_EL8 | yes |
10 | Rails SCL for Foreman 1.22 EL7 | MNSMITHUK_Foreman_Rails_SCL_for_Foreman_1_22_EL7 | yes |
---|--------------------------------|--------------------------------------------------|------------------|---------
[root@katello ~]# hammer activation-key content-override --name test --content-label "EPEL_7" --value 0 --organization-id 1
Updated content override.
[root@katello ~]# hammer activation-key product-content --name test --organization-id 1
---|--------------------------------|--------------------------------------------------|------------------|---------
ID | NAME | LABEL | DEFAULT ENABLED? | OVERRIDE
---|--------------------------------|--------------------------------------------------|------------------|---------
2 | CentOS 7.6.1810 Extras | MNSMITHUK_CentOS_CentOS_7_6_1810_Extras | yes |
1 | CentOS 7.6.1810 OS | MNSMITHUK_CentOS_CentOS_7_6_1810_OS | yes |
3 | CentOS 7.6.1810 Updates | MNSMITHUK_CentOS_CentOS_7_6_1810_Updates | yes |
4 | EPEL 7 | MNSMITHUK_EPEL_EPEL_7 | yes |
8 | Foreman 1.22 Client EL7 | MNSMITHUK_Foreman_Foreman_1_22_Client_EL7 | yes |
7 | Foreman 1.22 EL7 | MNSMITHUK_Foreman_Foreman_1_22_EL7 | yes |
9 | Foreman 1.22 Plugins EL7 | MNSMITHUK_Foreman_Foreman_1_22_Plugins_EL7 | yes |
5 | Puppet 5 EL7 | MNSMITHUK_Puppet_Puppet_5_EL7 | yes |
6 | Puppet 5 EL8 | MNSMITHUK_Puppet_Puppet_5_EL8 | yes |
10 | Rails SCL for Foreman 1.22 EL7 | MNSMITHUK_Foreman_Rails_SCL_for_Foreman_1_22_EL7 | yes |
---|--------------------------------|--------------------------------------------------|------------------|---------
[root@katello ~]# hammer activation-key content-override --name test --content-label "EPEL_7" --value 1 --organization-id 1
Updated content override.
[root@katello ~]# hammer activation-key product-content --name test --organization-id 1
---|--------------------------------|--------------------------------------------------|------------------|---------
ID | NAME | LABEL | DEFAULT ENABLED? | OVERRIDE
---|--------------------------------|--------------------------------------------------|------------------|---------
2 | CentOS 7.6.1810 Extras | MNSMITHUK_CentOS_CentOS_7_6_1810_Extras | yes |
1 | CentOS 7.6.1810 OS | MNSMITHUK_CentOS_CentOS_7_6_1810_OS | yes |
3 | CentOS 7.6.1810 Updates | MNSMITHUK_CentOS_CentOS_7_6_1810_Updates | yes |
4 | EPEL 7 | MNSMITHUK_EPEL_EPEL_7 | yes |
8 | Foreman 1.22 Client EL7 | MNSMITHUK_Foreman_Foreman_1_22_Client_EL7 | yes |
7 | Foreman 1.22 EL7 | MNSMITHUK_Foreman_Foreman_1_22_EL7 | yes |
9 | Foreman 1.22 Plugins EL7 | MNSMITHUK_Foreman_Foreman_1_22_Plugins_EL7 | yes |
5 | Puppet 5 EL7 | MNSMITHUK_Puppet_Puppet_5_EL7 | yes |
6 | Puppet 5 EL8 | MNSMITHUK_Puppet_Puppet_5_EL8 | yes |
10 | Rails SCL for Foreman 1.22 EL7 | MNSMITHUK_Foreman_Rails_SCL_for_Foreman_1_22_EL7 | yes |
---|--------------------------------|--------------------------------------------------|------------------|---------

Extract from production.log

2019-07-03T13:16:02 [I|app|014c85d5] Started PUT "/katello/api/activation_keys/4/content_override" for 192.168.77.5 at 2019-07-03 13:16:02 +0100
2019-07-03T13:16:02 [I|app|014c85d5] Processing by Katello::Api::V2::ActivationKeysController#content_override as JSON
2019-07-03T13:16:02 [I|app|014c85d5] Parameters: {"content_overrides"=>[{"content_label"=>"EPEL_7", "value"=>"[FILTERED]", "name"=>"enabled"}], "api_version"=>"v2", "id"=>"4", "activation_key"=>{}}

.
.
.

2019-07-03T13:16:02 [I|app|014c85d5] Started PUT "/katello/api/activation_keys/4/content_override" for 192.168.77.5 at 2019-07-03 13:16:02 +0100
2019-07-03T13:16:02 [I|app|014c85d5] Processing by Katello::Api::V2::ActivationKeysController#content_override as JSON
2019-07-03T13:16:24 [I|app|66ce16a3] Processing by Katello::Api::V2::ActivationKeysController#content_override as JSON
2019-07-03T13:16:24 [I|app|66ce16a3] Parameters: {"content_overrides"=>[{"content_label"=>"EPEL_7", "value"=>"[FILTERED]", "name"=>"enabled"}], "api_version"=>"v2", "id"=>"4", "activation_key"=>{}}

Actions #1

Updated by Suraj Patil almost 5 years ago

Hello,

It is working in satellite 6.5 (foreman-1.20.1.34-1.el7sat.noarch). Hammer does not actually update the "Default Enabled?" field rather it adds the entry in the "OVERRIDE" column. Please see the below output.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[root@satellite64 ]# hammer activation-key product-content --name demo --organization-id 1
-----|---------------------------------------------------------------|----------------------------------------|------------------|----------
ID | NAME | LABEL | DEFAULT ENABLED? | OVERRIDE
-----|---------------------------------------------------------------|----------------------------------------|------------------|----------
5531 | epel | RedHat_test-rpm_epel | yes |
1757 | Red Hat Enterprise Linux 7 Server (Kickstart) | rhel-7-server-kickstart | no |
1756 | Red Hat Enterprise Linux 7 Server (RPMs) | rhel-7-server-rpms | yes |
5100 | Red Hat Enterprise Linux 8 for x86_64 - AppStream (Kickstart) | rhel-8-for-x86_64-appstream-kickstart | no |
5098 | Red Hat Enterprise Linux 8 for x86_64 - BaseOS (Kickstart) | rhel-8-for-x86_64-baseos-kickstart | no |
1942 | Red Hat Satellite Tools 6.4 (for RHEL 7 Server) (RPMs) | rhel-7-server-satellite-tools-6.4-rpms | no | enabled:1
-----|---------------------------------------------------------------|----------------------------------------|------------------|----------
[root@satellite64 ~]# hammer activation-key content-override --name demo --content-label "RedHat_test-rpm_epel" --value 0 --organization-id 1
Updated content override.
[root@satellite64 ~]# hammer activation-key product-content --name demo --organization-id 1
-----|---------------------------------------------------------------|----------------------------------------|------------------|----------
ID | NAME | LABEL | DEFAULT ENABLED? | OVERRIDE
-----|---------------------------------------------------------------|----------------------------------------|------------------|----------
5531 | epel | RedHat_test-rpm_epel | yes | enabled:0
1757 | Red Hat Enterprise Linux 7 Server (Kickstart) | rhel-7-server-kickstart | no |
1756 | Red Hat Enterprise Linux 7 Server (RPMs) | rhel-7-server-rpms | yes |
5100 | Red Hat Enterprise Linux 8 for x86_64 - AppStream (Kickstart) | rhel-8-for-x86_64-appstream-kickstart | no |
5098 | Red Hat Enterprise Linux 8 for x86_64 - BaseOS (Kickstart) | rhel-8-for-x86_64-baseos-kickstart | no |
1942 | Red Hat Satellite Tools 6.4 (for RHEL 7 Server) (RPMs) | rhel-7-server-satellite-tools-6.4-rpms | no | enabled:1
-----|---------------------------------------------------------------|----------------------------------------|------------------|----------
[root@satellite64 ~]#
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Actions #2

Updated by Matthew Smith almost 5 years ago

Thanks Suraj. I do understand that the command should change the override column in the table and glad it is working in Satellite 6.5 for you, however I am just highlighting that I found that it is not working in Katello 3.12.

Suraj Patil wrote:

Hello,

It is working in satellite 6.5 (foreman-1.20.1.34-1.el7sat.noarch). Hammer does not actually update the "Default Enabled?" field rather it adds the entry in the "OVERRIDE" column. Please see the below output.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[root@satellite64 ]# hammer activation-key product-content --name demo --organization-id 1
-----|---------------------------------------------------------------|----------------------------------------|------------------|----------
ID | NAME | LABEL | DEFAULT ENABLED? | OVERRIDE
-----|---------------------------------------------------------------|----------------------------------------|------------------|----------
5531 | epel | RedHat_test-rpm_epel | yes |
1757 | Red Hat Enterprise Linux 7 Server (Kickstart) | rhel-7-server-kickstart | no |
1756 | Red Hat Enterprise Linux 7 Server (RPMs) | rhel-7-server-rpms | yes |
5100 | Red Hat Enterprise Linux 8 for x86_64 - AppStream (Kickstart) | rhel-8-for-x86_64-appstream-kickstart | no |
5098 | Red Hat Enterprise Linux 8 for x86_64 - BaseOS (Kickstart) | rhel-8-for-x86_64-baseos-kickstart | no |
1942 | Red Hat Satellite Tools 6.4 (for RHEL 7 Server) (RPMs) | rhel-7-server-satellite-tools-6.4-rpms | no | enabled:1
-----|---------------------------------------------------------------|----------------------------------------|------------------|----------
[root@satellite64 ~]# hammer activation-key content-override --name demo --content-label "RedHat_test-rpm_epel" --value 0 --organization-id 1
Updated content override.
[root@satellite64 ~]# hammer activation-key product-content --name demo --organization-id 1
-----|---------------------------------------------------------------|----------------------------------------|------------------|----------
ID | NAME | LABEL | DEFAULT ENABLED? | OVERRIDE
-----|---------------------------------------------------------------|----------------------------------------|------------------|----------
5531 | epel | RedHat_test-rpm_epel | yes | enabled:0
1757 | Red Hat Enterprise Linux 7 Server (Kickstart) | rhel-7-server-kickstart | no |
1756 | Red Hat Enterprise Linux 7 Server (RPMs) | rhel-7-server-rpms | yes |
5100 | Red Hat Enterprise Linux 8 for x86_64 - AppStream (Kickstart) | rhel-8-for-x86_64-appstream-kickstart | no |
5098 | Red Hat Enterprise Linux 8 for x86_64 - BaseOS (Kickstart) | rhel-8-for-x86_64-baseos-kickstart | no |
1942 | Red Hat Satellite Tools 6.4 (for RHEL 7 Server) (RPMs) | rhel-7-server-satellite-tools-6.4-rpms | no | enabled:1
-----|---------------------------------------------------------------|----------------------------------------|------------------|----------
[root@satellite64 ~]#
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Actions #3

Updated by Chris Roberts almost 5 years ago

  • Project changed from Hammer CLI CSV to Katello
  • Category set to Hammer
  • Target version set to Katello 3.13.0
Actions #4

Updated by Chris Roberts almost 5 years ago

  • Triaged changed from No to Yes
Actions #5

Updated by Matthew Smith almost 5 years ago

Matthew Smith wrote:

Thanks Suraj. I do understand that the command should change the override column in the table and glad it is working in Satellite 6.5 for you, however I am just highlighting that I found that it is not working in Katello 3.12.

Suraj Patil wrote:

Hello,

It is working in satellite 6.5 (foreman-1.20.1.34-1.el7sat.noarch). Hammer does not actually update the "Default Enabled?" field rather it adds the entry in the "OVERRIDE" column. Please see the below output.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[root@satellite64 ]# hammer activation-key product-content --name demo --organization-id 1
-----|---------------------------------------------------------------|----------------------------------------|------------------|----------
ID | NAME | LABEL | DEFAULT ENABLED? | OVERRIDE
-----|---------------------------------------------------------------|----------------------------------------|------------------|----------
5531 | epel | RedHat_test-rpm_epel | yes |
1757 | Red Hat Enterprise Linux 7 Server (Kickstart) | rhel-7-server-kickstart | no |
1756 | Red Hat Enterprise Linux 7 Server (RPMs) | rhel-7-server-rpms | yes |
5100 | Red Hat Enterprise Linux 8 for x86_64 - AppStream (Kickstart) | rhel-8-for-x86_64-appstream-kickstart | no |
5098 | Red Hat Enterprise Linux 8 for x86_64 - BaseOS (Kickstart) | rhel-8-for-x86_64-baseos-kickstart | no |
1942 | Red Hat Satellite Tools 6.4 (for RHEL 7 Server) (RPMs) | rhel-7-server-satellite-tools-6.4-rpms | no | enabled:1
-----|---------------------------------------------------------------|----------------------------------------|------------------|----------
[root@satellite64 ~]# hammer activation-key content-override --name demo --content-label "RedHat_test-rpm_epel" --value 0 --organization-id 1
Updated content override.
[root@satellite64 ~]# hammer activation-key product-content --name demo --organization-id 1
-----|---------------------------------------------------------------|----------------------------------------|------------------|----------
ID | NAME | LABEL | DEFAULT ENABLED? | OVERRIDE
-----|---------------------------------------------------------------|----------------------------------------|------------------|----------
5531 | epel | RedHat_test-rpm_epel | yes | enabled:0
1757 | Red Hat Enterprise Linux 7 Server (Kickstart) | rhel-7-server-kickstart | no |
1756 | Red Hat Enterprise Linux 7 Server (RPMs) | rhel-7-server-rpms | yes |
5100 | Red Hat Enterprise Linux 8 for x86_64 - AppStream (Kickstart) | rhel-8-for-x86_64-appstream-kickstart | no |
5098 | Red Hat Enterprise Linux 8 for x86_64 - BaseOS (Kickstart) | rhel-8-for-x86_64-baseos-kickstart | no |
1942 | Red Hat Satellite Tools 6.4 (for RHEL 7 Server) (RPMs) | rhel-7-server-satellite-tools-6.4-rpms | no | enabled:1
-----|---------------------------------------------------------------|----------------------------------------|------------------|----------
[root@satellite64 ~]#
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I have found the problem. The override is actually working. I had mised off the ORG name and the Product name from the content-label. In my example above the content-label should have been MNSMITHUK_EPEL_EPEL_7 and not just EPEL_7. However I still think this is a bug because an error should have been reported to say the content-label EPEL_7 does not exist rather than the message "Updated content override." that suggests something was updated.

Actions #6

Updated by John Mitsch over 4 years ago

  • Target version changed from Katello 3.13.0 to Katello 3.14.0
Actions #7

Updated by The Foreman Bot over 4 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to John Mitsch
  • Pull request https://github.com/Katello/katello/pull/8269 added
Actions #8

Updated by The Foreman Bot over 4 years ago

  • Fixed in Releases Katello 3.14.0 added
Actions #9

Updated by John Mitsch over 4 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF