RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 1427069 - subscription-manager client should give priority to the repo overrides set in normal subscriptions when they are attached in "content access" mode.
Summary: subscription-manager client should give priority to the repo overrides set in...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: William Poteat
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-27 09:39 UTC by Rehana
Modified: 2021-03-01 19:06 UTC (History)
6 users (show)

Fixed In Version: subscription-manager-1.19.13-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 19:21:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin subscription-manager pull 1560 0 'None' closed 1427069: Prioritize content from Basic entitlements 2020-10-12 13:27:22 UTC
Github candlepin subscription-manager pull 1615 0 'None' closed 1427069: Add secondary file to determine external repo file changes 2020-10-12 13:27:22 UTC
Red Hat Product Errata RHBA-2017:2083 0 normal SHIPPED_LIVE python-rhsm and subscription-manager bug fix and enhancement update 2017-08-01 18:14:19 UTC

Description Rehana 2017-02-27 09:39:07 UTC
Description of problem:
Observed that content overrides set at SKU level where ignored when those subscriptions where attached along with golden ticket subscriptions.

Version-Release number of selected component (if applicable):
subscription management server: 2.0.26-1
subscription management rules: 5.21
subscription-manager: 1.19.1-1.git.9.908316a.el6
python-rhsm: 1.19.1-1.git.3.9985682.el6


How reproducible:
always

Steps to Reproduce:
1.Create SKU level content override for the product say : awesomeos-onesocketib in test data , Set repo " content-label" to enabled.
2.register client with org that's in content accessmode : ex: snowwhite
3.Verify the golden ticket subscription is attached
4.Now attach the subscription to which the sku level content override was set . 

Actual results:
Observed that the "repos" to which sku-level content override  enabled flag was set where ignored and those repo were set to "disabled"  

Expected results:
when subscriptions with content enabled flags were attached along with golden ticket subscription, subscription-manager client should give priority to those override repos from the normal subscriptions over the repos from golden ticket.

Additional info:

Steps with test data details 
a) Create content override 

curl -k -u username:password  --request GET "https://server:8443/candlepin/owners/snowwhite/products/awesomeos-instancebased?exclude=id&exclude=name&exclude=multiplier&excludeproductContent&exclude=dependentProductIds&exclude=href&exclude=created&exclude=updated&exclude=attributes.created&exclude=attributes.updated"

b) set content override enabled flag :

curl --stderr /dev/null --insecure --user username:password --request PUT --data '{"attributes":[{"name" : "instance_multiplier","value" : "2"}, {"name" : "sockets","value" : "2"}, {"name" : "vir_limit","value" : "1"}, {"name" : "host_limited","value" : "true"}, {"name" : "stacking_id","value" : "15"}, {"name" : "multi-entitlement","value" : "yes"}, {"name" : "support_level","value" : "Standard"}, {"name" : "support_type","value" : "L1-L3"}, {"name" : "version","value" : "1.0"}, {"name" : "variant","value" :"ALL"}, {"name" : "arch","value" : "ALL"}, {"name" : "type","value" : "MKT"}, {"name":"content_override_enabled","value":"1111"}]}' --header 'accept:application/json' --header 'content-type: application/json' https://server:8443/candlepin/owners/snowwhite/products/awesomeos-instancebased

c)refresh pools
 curl --stderr /dev/null --insecure --user username:password --request PUT https://server:8443/candlepin/owners/snowwhite/subscriptions 

d)below steps demonstrates that the content override exists when registered in normal mode

[root@dhcp35-181 ~]# subscription-manager register --force
The system with UUID f9e577e1-294a-4f19-b097-da86076881ba has been unregistered
Registering to: server:8443/candlepin
Username: admin
Password: 
Organization: snowwhite
The system has been registered with ID: 3323e2ff-ef36-44e0-8a71-55053b7c7cb0 
[root@dhcp35-181 ~]# subscription-manager attach --pool 8ac6a3635a6f97cd015a6f999e3f0adc
Successfully attached a subscription for: Awesome OS Instance Based (Standard Support)
[root@dhcp35-181 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Awesome OS Instance Based (Standard Support)
Provides:            Awesome OS Instance Server Bits
SKU:                 awesomeos-instancebased
Contract:            0
Account:             12331131231
Serial:              8513447761758870400
Pool ID:             8ac6a3635a6f97cd015a6f999e3f0adc
Provides Management: No
Active:              True
Quantity Used:       1
Service Level:       Standard
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:   Instance Based
Starts:              02/23/2017
Ends:                02/23/2018
System Type:         Physical

[root@dhcp35-181 ~]# subscription-manager repos --list
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   content-label-empty-gpg
Repo Name: content-emptygpg
Repo URL:  https://cdn.redhat.com/foo/path
Enabled:   0

Repo ID:   content-label  =======>> NOTICE THE "CONTENT-LABEL" IS ENABLED
Repo Name: content
Repo URL:  https://cdn.redhat.com/foo/path
Enabled:   1

Repo ID:   content-label-no-gpg
Repo Name: content-nogpg
Repo URL:  https://cdn.redhat.com/foo/path
Enabled:   0

Repo ID:   never-enabled-content
Repo Name: never-enabled-content
Repo URL:  https://cdn.redhat.com/foo/path/never
Enabled:   0

e) Now switch to "content access mode "
 curl -X PUT -k -u username:password   -d '{"contentAccessMode":"org_environment"}'  -H "Content-Type: application/json"  "https://server:8443/candlepin/owners/snowwhite" 

f) REgister the client and attach the same pool 
[root@dhcp35-181 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Awesome OS Instance Based (Standard Support)
Provides:            Awesome OS Instance Server Bits
SKU:                 awesomeos-instancebased
Contract:            0
Account:             12331131231
Serial:              4545865750486743882
Pool ID:             8ac6a3635a6f97cd015a6f999e3f0adc
Provides Management: No
Active:              True
Quantity Used:       1
Service Level:       Standard
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:   Instance Based
Starts:              02/23/2017
Ends:                02/23/2018
System Type:         Physical

Subscription Name:   Content Access
Provides:             Content Access
SKU:                 content_access
Contract:            
Account:             
Serial:              7600163377491081174
Pool ID:             Not Available
Provides Management: No
Active:              True
Quantity Used:       1
Service Level:       
Service Type:        
Status Details:      Subscription is current
Subscription Type:   
Starts:              02/27/2017
Ends:                02/27/2018
System Type:         Physical

[root@dhcp35-181 ~]# subscription-manager repos --list
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   awesomeos-ia64-only-content
Repo Name: awesomeos-ia64-only-content
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   awesomeos-i386-only-content
Repo Name: awesomeos-i386-only-content
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   snowy-content-label
Repo Name: snowy-content
Repo URL:  https://cdn.redhat.com/snowwhite/snowy/foo/path
Enabled:   0

Repo ID:   never-enabled-content
Repo Name: never-enabled-content
Repo URL:  https://cdn.redhat.com/foo/path/never
Enabled:   0

Repo ID:   awesomeos-all
Repo Name: awesomeos-all
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   awesomeos-ppc-only-content
Repo Name: awesomeos-ppc-only-content
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   awesomeos-x86_64-only-content
Repo Name: awesomeos-x86_64-only-content
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   awesomeos-ppc64
Repo Name: awesomeos-ppc64
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/ppc64
Enabled:   0

Repo ID:   awesomeos-s390x
Repo Name: awesomeos-s390x
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/s390x
Enabled:   0

Repo ID:   awesomeos-ia64
Repo Name: awesomeos-ia64
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/ia64
Enabled:   0

Repo ID:   awesomeos-i686
Repo Name: awesomeos-i686
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/i686
Enabled:   0

Repo ID:   awesomeos-x86_64
Repo Name: awesomeos-x86_64
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/x86_64
Enabled:   0

Repo ID:   awesomeos-ppc64-only-content
Repo Name: awesomeos-ppc64-only-content
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   awesomeos-s390x-only-content
Repo Name: awesomeos-s390x-only-content
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   awesomeos-x86_64-i386-content
Repo Name: awesomeos-x86_64-i386-content
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   content-label-empty-gpg
Repo Name: content-emptygpg
Repo URL:  https://cdn.redhat.com/foo/path
Enabled:   0

Repo ID:   awesomeos-i386
Repo Name: awesomeos-i386
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/i386
Enabled:   0

Repo ID:   awesomeos-x86
Repo Name: awesomeos-x86
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/$releasever/x86
Enabled:   0

Repo ID:   awesomeos
Repo Name: awesomeos
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/$basearch/$releasever/awesomeos
Enabled:   0

Repo ID:   awesomeos-ppc
Repo Name: awesomeos-ppc
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/ppc
Enabled:   0

Repo ID:   content-label ==>  THE "CONTENT LABEL" CONTENT SET IS DISABLED 
Repo Name: content
Repo URL:  https://cdn.redhat.com/foo/path
Enabled:   0

Repo ID:   snowy-never-enabled-content
Repo Name: snowy-never-enabled-content
Repo URL:  https://cdn.redhat.com/snowwhite/snowy/foo/path/never
Enabled:   0

Repo ID:   content-label-no-gpg
Repo Name: content-nogpg
Repo URL:  https://cdn.redhat.com/foo/path
Enabled:   0

[root@dhcp35-181 ~]# subscription-manager repos --list-enabled
There were no available repositories matching the specified criteria.

Comment 4 Rehana 2017-04-11 09:46:33 UTC
Retested on ;

subscription management server: 2.1.0-1
subscription management rules: 5.23
subscription-manager: 1.19.4-1.el7
python-rhsm: 1.19.2-1.el7

Observed that content-overrides set at SKU level still ignored when those subscriptions are attached along with golden ticket. 

Follow the same steps mentioned in Description to create override.

Skipping those steps , successfully created content_override for "content-label"

Below steps shows that content-override exists when registered in normal mode

[root@rhel74fqdntest ~]# subscription-manager register --force
The system with UUID 61c2d276-8df9-4425-ad5f-934893c00ed8 has been unregistered
Registering to: F21-candlepin.usersys.redhat.com:8443/candlepin
Username: admin
Password: 
Organization: snowwhite
The system has been registered with ID: 3f55aeed-0987-4b4a-ac82-adc25f8b04a5 
[root@rhel74fqdntest ~]# ll /etc/pki/entitlement/
total 0


[root@rhel74fqdntest ~]# subscription-manager attach --pool 8ac6a3635b5c3c75015b5c3d592a070b
Successfully attached a subscription for: Awesome OS Instance Based (Standard Support)

[root@rhel74fqdntest ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Awesome OS Instance Based (Standard Support)
Provides:            Awesome OS Instance Server Bits
SKU:                 awesomeos-instancebased
Contract:            1
Account:             12331131231
Serial:              5668774287668471304
Pool ID:             8ac6a3635b5c3c75015b5c3d592a070b
Provides Management: No
Active:              True
Quantity Used:       1
Service Level:       Standard
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:   Instance Based
Starts:              04/11/2017
Ends:                04/11/2018
System Type:         Physical

[root@rhel74fqdntest ~]# subscription-manager repos --list 
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   content-label-empty-gpg
Repo Name: content-emptygpg
Repo URL:  https://cdn.redhat.com/foo/path
Enabled:   0

Repo ID:   content-label   ==>> content override
Repo Name: content
Repo URL:  https://cdn.redhat.com/foo/path
Enabled:   1

Repo ID:   content-label-no-gpg
Repo Name: content-nogpg
Repo URL:  https://cdn.redhat.com/foo/path
Enabled:   0

Repo ID:   never-enabled-content
Repo Name: never-enabled-content
Repo URL:  https://cdn.redhat.com/foo/path/never
Enabled:   0

[root@rhel74fqdntest ~]# ll /etc/pki/entitlement/
total 8
-rw-------. 1 root root 1679 Apr 11 15:05 5668774287668471304-key.pem
-rw-r--r--. 1 root root 2457 Apr 11 15:05 5668774287668471304.pem


Now switch the org to "Content Access mode" and re-register the system and attach the same subscription along with golden ticket

[root@rhel74fqdntest ~]# subscription-manager register
Registering to: F21-candlepin.usersys.redhat.com:8443/candlepin
Username: admin
Password: 
Organization: snowwhite
The system has been registered with ID: b73a274a-3188-4a47-85f3-13f4df3bd9ac 


[root@rhel74fqdntest ~]# ll /etc/pki/entitlement/
total 8
-rw-------. 1 root root 1679 Apr 11 15:11 5001504457131107750-key.pem
-rw-r--r--. 1 root root 2874 Apr 11 15:11 5001504457131107750.pem

[root@rhel74fqdntest ~]# subscription-manager repos --list
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   awesomeos-ia64-only-content
Repo Name: awesomeos-ia64-only-content
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   awesomeos-i386-only-content
Repo Name: awesomeos-i386-only-content
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   snowy-content-label
Repo Name: snowy-content
Repo URL:  https://cdn.redhat.com/snowwhite/snowy/foo/path
Enabled:   0

Repo ID:   never-enabled-content
Repo Name: never-enabled-content
Repo URL:  https://cdn.redhat.com/snowwhite/foo/path/never
Enabled:   0

Repo ID:   awesomeos-all
Repo Name: awesomeos-all
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   awesomeos-ppc-only-content
Repo Name: awesomeos-ppc-only-content
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   awesomeos-x86_64-only-content
Repo Name: awesomeos-x86_64-only-content
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   awesomeos-ppc64
Repo Name: awesomeos-ppc64
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/ppc64
Enabled:   0

Repo ID:   awesomeos-s390x
Repo Name: awesomeos-s390x
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/s390x
Enabled:   0

Repo ID:   awesomeos-ia64
Repo Name: awesomeos-ia64
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/ia64
Enabled:   0

Repo ID:   awesomeos-i686
Repo Name: awesomeos-i686
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/i686
Enabled:   0

Repo ID:   awesomeos-x86_64
Repo Name: awesomeos-x86_64
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/x86_64
Enabled:   0

Repo ID:   awesomeos-ppc64-only-content
Repo Name: awesomeos-ppc64-only-content
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   awesomeos-s390x-only-content
Repo Name: awesomeos-s390x-only-content
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   awesomeos-x86_64-i386-content
Repo Name: awesomeos-x86_64-i386-content
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   content-label-empty-gpg
Repo Name: content-emptygpg
Repo URL:  https://cdn.redhat.com/snowwhite/foo/path
Enabled:   0

Repo ID:   awesomeos-i386
Repo Name: awesomeos-i386
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/i386
Enabled:   0

Repo ID:   awesomeos-x86
Repo Name: awesomeos-x86
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/$releasever/x86
Enabled:   0

Repo ID:   awesomeos
Repo Name: awesomeos
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/$basearch/$releasever/awesomeos
Enabled:   0

Repo ID:   awesomeos-ppc
Repo Name: awesomeos-ppc
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/ppc
Enabled:   0

Repo ID:   content-label ==> Still disabled
Repo Name: content
Repo URL:  https://cdn.redhat.com/snowwhite/foo/path
Enabled:   0

Repo ID:   snowy-never-enabled-content
Repo Name: snowy-never-enabled-content
Repo URL:  https://cdn.redhat.com/snowwhite/snowy/foo/path/never
Enabled:   0

Repo ID:   content-label-no-gpg
Repo Name: content-nogpg
Repo URL:  https://cdn.redhat.com/snowwhite/foo/path
Enabled:   0

[root@rhel74fqdntest ~]# subscription-manager attach --pool 8ac6a3635b5c3c75015b5c3d592a070b
Successfully attached a subscription for: Awesome OS Instance Based (Standard Support)

[root@rhel74fqdntest ~]# ll /etc/pki/entitlement/
total 16
-rw-------. 1 root root 1679 Apr 11 15:12 5001504457131107750-key.pem
-rw-r--r--. 1 root root 2874 Apr 11 15:12 5001504457131107750.pem
-rw-------. 1 root root 1679 Apr 11 15:12 8725512487119691144-key.pem
-rw-r--r--. 1 root root 2457 Apr 11 15:12 8725512487119691144.pem

[root@rhel74fqdntest ~]# subscription-manager repos --list-enabled
There were no available repositories matching the specified criteria.

Observed that the repo " Content-label" is still disabled. 

Hence moving the bug back to New

Comment 5 Kevin Howell 2017-04-12 14:46:48 UTC
Rehana, I noticed that you tested against subscription-manager-1.19.4-1.el7. The fix was included in subscription-manager-1.19.5-1.el7. Can you please retest against the latest build?

Comment 6 Shwetha Kallesh 2017-04-13 14:16:16 UTC
Still failing with following version:

[root@dhcp35-160 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.1.0-1
subscription management rules: 5.23
subscription-manager: 1.19.7-1.el7
python-rhsm: 1.19.4-1.el7



Switch to content access mode:

[root@Shwetha-candlepin server]# curl -X PUT -k -u admin:admin   -d '{"contentAccessMode":"org_environment"}'  -H "Content-Type: application/json"  "https://Shwetha-candlepin.usersys.redhat.com:8443/candlepin/owners/snowwhite" | python -mjson.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   437    0   398  100    39   2101    205 --:--:-- --:--:-- --:--:--  2117
{
    "autobindDisabled": null,
    "contentAccessMode": "org_environment",
    "contentAccessModeList": "org_environment",
    "contentPrefix": null,
    "created": "2017-04-13T13:18:21+0000",
    "defaultServiceLevel": null,
    "displayName": "Snow White",
    "href": "/owners/snowwhite",
    "id": "8ac6a3185b6776d0015b6776f5790004",
    "key": "snowwhite",
    "logLevel": null,
    "parentOwner": null,
    "updated": "2017-04-13T13:43:50+0000",
    "upstreamConsumer": null
}

Register to snowwhite org and get a golden ticket:

[root@dhcp35-160 ~]# subscription-manager register --force --serverurl Shwetha-candlepin.usersys.redhat.com:8443/candlepin
The system with UUID abb49697-60d1-48f7-9237-28efe600e2eb has been unregistered
Registering to: Shwetha-candlepin.usersys.redhat.com:8443/candlepin
Username: admin
Password: 
Organization: snowwhite
The system has been registered with ID: 411e5e6d-8c7f-4266-9cb0-697b0ca70a5d 

[root@dhcp35-160 ~]# ls /etc/pki/entitlement/
7684901983102731476-key.pem  7684901983102731476.pem

No repos are enabled in golden ticket mode:

[root@dhcp35-160 ~]# subscription-manager repos --list-enabled 
There were no available repositories matching the specified criteria.

Attach a subscription:
[root@dhcp35-160 ~]# subscription-manager attach --pool 8ac6a3185b6776d0015b677855ee0875
Successfully attached a subscription for: Awesome OS Instance Based one socket


[root@dhcp35-160 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Awesome OS Instance Based one socket
Provides:            Awesome OS Instance Server Bits
SKU:                 awesomeos-onesocketib
Contract:            1
Account:             12331131231
Serial:              1441827408402073990
Pool ID:             8ac6a3185b6776d0015b677855ee0875
Provides Management: No
Active:              True
Quantity Used:       8
Service Level:       Standard
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:   Instance Based
Starts:              04/13/2017
Ends:                04/13/2018
System Type:         Physical


List a repo to override at sku level:
-----------------------------------------
[root@dhcp35-160 ~]# curl --stderr /dev/null --insecure --user admin:admin --request GET https://Shwetha-candlepin.usersys.redhat.com:8443/candlepin/content/ | python -mjson.tool | grep "never-enabled-content" -B1
        "id": "100",
        "label": "never-enabled-content",
--

Get the attributes of the SKU:
---------------------------------
[root@dhcp35-160 ~]# curl -k -u admin:admin  --request GET "https://Shwetha-candlepin.usersys.redhat.com:8443/candlepin/owners/snowwhite/products/awesomeos-onesocketib?exclude=id&exclude=name&exclude=multiplier&excludeproductContent&exclude=dependentProductIds&exclude=href&exclude=created&exclude=updated&exclude=attributes.created&exclude=attributes.updated"
{"uuid":"8ac6a3185b6776d0015b677816f101a3","attributes":[{"name":"host_limited","value":"true"},{"name":"instance_multiplier","value":"2"},{"name":"stacking_id","value":"15"},{"name":"support_level","value":"Standard"},{"name":"type","value":"MKT"},{"name":"version","value":"1.0"},{"name":"multi-entitlement","value":"yes"},{"name":"virt_limit","value":"1"},{"name":"variant","value":"ALL"},{"name":"arch","value":"ALL"},{"name":"sockets","value":"1"},{"name":"support_type","value":"L1-L3"}],"productContent":[]}[root@dhcp35-160 ~]# 


Enable th repo at SKu level:
[root@dhcp35-160 ~]# curl --stderr /dev/null --insecure --user admin:admin --request PUT --data '{"attributes":[{"name" : "instance_multiplier","value" : "2"}, {"name" : "sockets","value" : "2"}, {"name" : "vir_limit","value" : "1"}, {"name" : "host_limited","value" : "true"}, {"name" : "stacking_id","value" : "15"}, {"name" : "multi-entitlement","value" : "yes"}, {"name" : "support_level","value" : "Standard"}, {"name" : "support_type","value" : "L1-L3"}, {"name" : "version","value" : "1.0"}, {"name" : "variant","value" :"ALL"}, {"name" : "arch","value" : "ALL"}, {"name" : "type","value" : "MKT"},{"name":"host_limited","value":"true"},{"name":"instance_multiplier","value":"2"},{"name":"stacking_id","value":"15"},{"name":"support_level","value":"Standard"},{"name":"type","value":"MKT"},{"name":"version","value":"1.0"},{"name":"multi-entitlement","value":"yes"},{"name":"virt_limit","value":"1"},{"name":"variant","value":"ALL"},{"name":"arch","value":"ALL"},{"name":"sockets","value":"1"},{"name":"support_type","value":"L1-L3"}, {"name":"content_override_enabled","value":"100"}]}' --header 'accept:application/json' --header 'content-type: application/json' https://Shwetha-candlepin.usersys.redhat.com:8443/candlepin/owners/snowwhite/products/awesomeos-onesocketib | python -mjson.tool
{
    "attributes": [
        {
            "name": "host_limited",
            "value": "true"
        },
        {
            "name": "instance_multiplier",
            "value": "2"
        },
        {
            "name": "stacking_id",
            "value": "15"
        },
        {
            "name": "support_level",
            "value": "Standard"
        },
        {
            "name": "type",
            "value": "MKT"
        },
        {
            "name": "version",
            "value": "1.0"
        },
        {
            "name": "multi-entitlement",
            "value": "yes"
        },
        {
            "name": "virt_limit",
            "value": "1"
        },
        {
            "name": "vir_limit",
            "value": "1"
        },
        {
            "name": "variant",
            "value": "ALL"
        },
        {
            "name": "arch",
            "value": "ALL"
        },
        {
            "name": "sockets",
            "value": "1"
        },
        {
            "name": "support_type",
            "value": "L1-L3"
        },
        {
            "name": "content_override_enabled",
            "value": "100"
        }
    ],
    "created": "2017-04-13T13:19:23+0000",
    "dependentProductIds": [],
    "href": "/products/8ac6a3185b6776d0015b679ae7e90ade",
    "id": "awesomeos-onesocketib",
    "multiplier": 1,
    "name": "Awesome OS Instance Based one socket",
    "productContent": [],
    "updated": "2017-04-13T13:57:36+0000",
    "uuid": "8ac6a3185b6776d0015b679ae7e90ade"
}

refresh the pools:

curl --stderr /dev/null --insecure --user admin:admin --request PUT https://Shwetha-candlepin.usersys.redhat.com:8443/candlepin/owners/snowwhite/subscriptions 
{"id":"refresh_pools_3225732e-f38b-4316-bd34-f2f58c19533b","state":"CREATED","startTime":null,"finishTime":null,"result":null,"principalName":"admin","targetType":"owner","targetId":"snowwhite","ownerId":"snowwhite","correlationId":null,"resultData":null,"done":false,"statusPath":"/jobs/refresh_pools_3225732e-f38b-4316-bd34-f2f58c19533b","group":"async group","created":"2017-04-13T14:04:32+0000","updated":"2017-04-13T14:04:32+0000"}[root@dhcp35-160 ~]# 

Still no repos are enabled:
[root@dhcp35-160 ~]# subscription-manager repos --list-enabled 
There were no available repositories matching the specified criteria.

Remove the subscription:

[root@dhcp35-160 ~]# subscription-manager remove --all
1 subscription removed at the server.
1 local certificate has been deleted.

[root@dhcp35-160 ~]# subscription-manager list --consumed
No consumed subscription pools to list

Attach the subscription back:
[root@dhcp35-160 ~]# subscription-manager attach --pool 8ac6a3185b6776d0015b677855ee0875
Successfully attached a subscription for: Awesome OS Instance Based one socket

Verify the repos --list-enabled again , dont see any repo enabled 
[root@dhcp35-160 ~]# subscription-manager repos --list-enabled 
There were no available repositories matching the specified criteria.

Comment 8 Rehana 2017-05-16 11:33:25 UTC
Retesting with : 

[root@inferno home]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.1.0-1
subscription management rules: 5.23
subscription-manager: 1.19.13-1.el7
python-rhsm: 1.19.6-1.el7

The following test scenario's will be verified 

1) Verify SKU level content overrided repos are given precedence when those SKU are attached along with golden ticket subscriptions 

2) Verify all the repos are disabled by default when *ONLY* gloden ticket subscriptions are attached

Get the repo id to create a sku level override 
===============================================
#curl --stderr /dev/null --insecure --user admin:admin --request GET https://F21-candlepin.usersys.redhat.com:8443/candlepin/content/ | python -mjson.tool | grep "never-enabled-content" -B1
--
        "id": "100",
        "label": "never-enabled-content",
--
Get the SKU attribute :
========================
[root@inferno ca]#  curl -k -u admin:admin  --request GET "https://F21-candlepin.usersys.redhat.com:8443/candlepin/owners/snowwhite/products/snowyos-onesocketib?exclude=id&exclude=name&exclude=multiplier&excludeproductContent&exclude=dependentProductIds&exclude=href&exclude=created&exclude=updated&exclude=attributes.created&exclude=attributes.updated"
{"uuid" : "8ac6a3625c10e1bf015c10e2cc8301f2","attributes" :
[ {"name" : "host_limited","value" : "true"},{"name" : "instance_multiplier","value" : "2"},{"name" : "stacking_id","value" : "15"},{"name" : "support_level","value" : "Standard"},{"name" : "type","value" : "MKT"}, {"name" : "version","value" : "1.0"}, {"name" : "multi-entitlement",  "value" : "yes"}, {"name" : "virt_limit","value" : "1"}, {"name" : "variant", "value" : "ALL"}, {"name" : "arch","value" : "ALL"}, {"name" : "sockets",  "value" : "1"}, {"name" : "support_type","value" : "L1-L3"} ],"productContent"  [ ]}[root@inferno ca]# 

Enable the repo "never-enabled-content" (id:100) at SKU level
============================================================
[root@inferno ca]# curl --stderr /dev/null --insecure --user admin:admin --request PUT --data '{"attributes":[{"name" : "host_limited","value" : "true"},{"name" : "instance_multiplier","value" : "2"},{"name" : "stacking_id","value" : "15"},{"name" : "support_level","value" : "Standard"},{"name" : "type","value" : "MKT"}, {"name" : "version","value" : "1.0"}, {"name" : "multi-entitlement",  "value" : "yes"}, {"name" : "virt_limit","value" : "1"}, {"name" : "variant", "value" : "ALL"}, {"name" : "arch","value" : "ALL"}, {"name" : "sockets",  "value" : "1"}, {"name" : "support_type","value" : "L1-L3"},{"name":"content_override_enabled","value":"100"}]}' --header 'accept:application/json' --header 'content-type: application/json' https://F21-candlepin.usersys.redhat.com:8443/candlepin/owners/snowwhite/products/snowyos-onesocketib | python -mjson.tool
{
    "attributes": [
        {
            "name": "host_limited",
            "value": "true"
        },
        {
            "name": "instance_multiplier",
            "value": "2"
        },
        {
            "name": "stacking_id",
            "value": "15"
        },
        {
            "name": "support_level",
            "value": "Standard"
        },
        {
            "name": "type",
            "value": "MKT"
        },
        {
            "name": "version",
            "value": "1.0"
        },
        {
            "name": "multi-entitlement",
            "value": "yes"
        },
        {
            "name": "virt_limit",
            "value": "1"
        },
        {
            "name": "variant",
            "value": "ALL"
        },
        {
            "name": "arch",
            "value": "ALL"
        },
        {
            "name": "sockets",
            "value": "1"
        },
        {
            "name": "support_type",
            "value": "L1-L3"
        },
        {
            "name": "content_override_enabled",
            "value": "100"
        }
    ],
    "created": "2017-05-16T10:51:53+0000",
    "dependentProductIds": [],
    "href": "/products/8ac6a3625c10e1bf015c10f2b21c0b19",
    "id": "snowyos-onesocketib",
    "multiplier": 1,
    "name": "Snowy OS Instance Based one socket",
    "productContent": [],
    "updated": "2017-05-16T11:09:19+0000",
    "uuid": "8ac6a3625c10e1bf015c10f2b21c0b19"
}

Refresh pools :
==============

[root@inferno ca]# curl --stderr /dev/null --insecure --user admin:admin --request PUT https://F21-candlepin.usersys.redhat.com:8443/candlepin/owners/snowwhite/subscriptions 
{
  "id" : "refresh_pools_c6bda983-a420-4188-88ee-f3609315fbbb",
  "state" : "CREATED",
  "startTime" : null,
  "finishTime" : null,
  "result" : null,
  "principalName" : "admin",
  "targetType" : "owner",
  "targetId" : "snowwhite",
  "ownerId" : "snowwhite",
  "correlationId" : null,
  "resultData" : null,
  "statusPath" : "/jobs/refresh_pools_c6bda983-a420-4188-88ee-f3609315fbbb",
  "done" : false,
  "group" : "async group",
  "created" : "2017-05-16T11:10:05+0000",
  "updated" : "2017-05-16T11:10:05+0000"
}[

Verifies the content "never-enabled-content" is enabled when registered and subscribed "snowyos-onesocketib" pool in normal mode

[root@inferno ca]# subscription-manager register
Registering to: F21-candlepin.usersys.redhat.com:8443/candlepin
Username: admin
Password: 
Organization: snowwhite
The system has been registered with ID: 813df188-609a-4a44-87e3-90e4dbc5c08e 

[root@inferno ca]# subscription-manager attach --pool 8ac6a3625c10e1bf015c10e2cfbb02b5
Successfully attached a subscription for: Snowy OS Instance Based one socket

[root@inferno ca]# subscription-manager repos --list-enabled
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   never-enabled-content
Repo Name: never-enabled-content
Repo URL:  https://cdn.redhat.com/foo/path/never
Enabled:   1

Above test steps demonstrates that the repo "never-enabled-conten" is enabled at the sku level

Scenario 1 ) switch to "content-accesss-mode" , Register (against "snowwhite") and attach the same subscription along with golden ticket subscription. Verify the subscription-manager repos --list-enabled contains "never-enabled-content" repo

[root@F21-candlepin certs]# curl -k -u admin:admin "https://localhost:8443/candlepin/owners/snowwhite" | python -mjson.tool | grep "contentAccess*"  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   469    0   469    0     0   5907      0 --:--:-- --:--:-- --:--:--  5862
    "contentAccessMode": "org_environment",
    "contentAccessModeList": "org_environment",

[root@inferno ca]# subscription-manager register
Registering to: F21-candlepin.usersys.redhat.com:8443/candlepin
Username: admin
Password: 
Organization: snowwhite
The system has been registered with ID: 68f18901-fa9d-4cfa-a8d4-cb805fee1c62 

[root@inferno ca]# subscription-manager attach --pool 8ac6a3625c10e1bf015c10e2cfbb02b5
Successfully attached a subscription for: Snowy OS Instance Based one socket

[root@inferno ca]# ll /etc/pki/entitlement/
total 16
-rw-------. 1 root root 1675 May 16 16:50 247371373744549420-key.pem
-rw-r--r--. 1 root root 2603 May 16 16:50 247371373744549420.pem
-rw-------. 1 root root 1675 May 16 16:50 7935278767028316567-key.pem
-rw-r--r--. 1 root root 2874 May 16 16:50 7935278767028316567.pem

[root@inferno ca]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Snowy OS Instance Based one socket
Provides:            Snowy OS Developer Bits
                     Awesome OS Instance Server Bits
                     Snowy OS Premium Architecture Bits
SKU:                 snowyos-onesocketib
Contract:            0
Account:             12331131231
Serial:              247371373744549420
Pool ID:             8ac6a3625c10e1bf015c10e2cfbb02b5
Provides Management: No
Active:              True
Quantity Used:       1
Service Level:       Standard
Service Type:        L1-L3
Status Details:      Guest has not been reported on any host and is using a temporary unmapped guest subscription.
Subscription Type:   Instance Based (Temporary)
Starts:              05/16/2017
Ends:                05/17/2017
System Type:         Virtual

[root@inferno ca]# subscription-manager repos --list-enabled
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   never-enabled-content
Repo Name: never-enabled-content
Repo URL:  https://cdn.redhat.com/foo/path/never
Enabled:   1

Result: Above test steps demonstrates that now overrided repos take precedence when those sku's are attached along with golden ticket subscriptions-- PASSED
------------------------------------------------------------------------------- 
2) Verify when *only* "golden ticket" subscription is attached , all the repos are disabled by default 

[root@inferno ca]# subscription-manager register --username=admin --password=admin --org=snowwhite
Registering to: F21-candlepin.usersys.redhat.com:8443/candlepin
The system has been registered with ID: 9e9b69a1-8e3b-4053-b94f-67d4a2dc154e 

[root@inferno ca]# ll /etc/pki/entitlement/
total 8
-rw-------. 1 root root 1675 May 16 16:53 3587097763492636432-key.pem
-rw-r--r--. 1 root root 2874 May 16 16:53 3587097763492636432.pem

[root@inferno ca]# subscription-manager list --consumed
No consumed subscription pools to list

[root@inferno ca]# subscription-manager repos --list-enabled
There were no available repositories matching the specified criteria.

[root@inferno ca]# subscription-manager repos --list
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   awesomeos-ia64-only-content
Repo Name: awesomeos-ia64-only-content
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   awesomeos-i386-only-content
Repo Name: awesomeos-i386-only-content
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   snowy-content-label
Repo Name: snowy-content
Repo URL:  https://cdn.redhat.com/snowwhite/snowy/foo/path
Enabled:   0

Repo ID:   never-enabled-content
Repo Name: never-enabled-content
Repo URL:  https://cdn.redhat.com/snowwhite/foo/path/never
Enabled:   0

Repo ID:   awesomeos-all
Repo Name: awesomeos-all
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   awesomeos-ppc-only-content
Repo Name: awesomeos-ppc-only-content
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   awesomeos-x86_64-only-content
Repo Name: awesomeos-x86_64-only-content
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   awesomeos-ppc64
Repo Name: awesomeos-ppc64
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/ppc64
Enabled:   0

Repo ID:   awesomeos-s390x
Repo Name: awesomeos-s390x
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/s390x
Enabled:   0

Repo ID:   awesomeos-ia64
Repo Name: awesomeos-ia64
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/ia64
Enabled:   0

Repo ID:   awesomeos-i686
Repo Name: awesomeos-i686
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/i686
Enabled:   0

Repo ID:   awesomeos-x86_64
Repo Name: awesomeos-x86_64
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/x86_64
Enabled:   0

Repo ID:   awesomeos-ppc64-only-content
Repo Name: awesomeos-ppc64-only-content
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   awesomeos-s390x-only-content
Repo Name: awesomeos-s390x-only-content
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   awesomeos-x86_64-i386-content
Repo Name: awesomeos-x86_64-i386-content
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/all
Enabled:   0

Repo ID:   content-label-empty-gpg
Repo Name: content-emptygpg
Repo URL:  https://cdn.redhat.com/snowwhite/foo/path
Enabled:   0

Repo ID:   awesomeos-i386
Repo Name: awesomeos-i386
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/i386
Enabled:   0

Repo ID:   awesomeos-x86
Repo Name: awesomeos-x86
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/$releasever/x86
Enabled:   0

Repo ID:   awesomeos
Repo Name: awesomeos
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/$basearch/$releasever/awesomeos
Enabled:   0

Repo ID:   awesomeos-ppc
Repo Name: awesomeos-ppc
Repo URL:  https://cdn.redhat.com/snowwhite/path/to/awesomeos/ppc
Enabled:   0

Repo ID:   content-label
Repo Name: content
Repo URL:  https://cdn.redhat.com/snowwhite/foo/path
Enabled:   0

Repo ID:   snowy-never-enabled-content
Repo Name: snowy-never-enabled-content
Repo URL:  https://cdn.redhat.com/snowwhite/snowy/foo/path/never
Enabled:   0

Repo ID:   content-label-no-gpg
Repo Name: content-nogpg
Repo URL:  https://cdn.redhat.com/snowwhite/foo/path
Enabled:   0

Above test steps demonstrates that when *only* golden ticket subscriptions are attached , all the repos are disabled by default.

conclusion :
============
Based on the above test observations , marking the bug as verified!!

Comment 9 errata-xmlrpc 2017-08-01 19:21:47 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-2017:2083


Note You need to log in before you can comment on or make changes to this bug.