Bug 807407 - subscription-manager should NOT substitute "" for $releasever when attribute releaseVer is not set on consumer
subscription-manager should NOT substitute "" for $releasever when attribute ...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager (Show other bugs)
6.3
Unspecified Unspecified
unspecified Severity urgent
: rc
: ---
Assigned To: William Poteat
Entitlement Bugs
:
Depends On:
Blocks: 738066
  Show dependency treegraph
 
Reported: 2012-03-27 13:29 EDT by John Sefler
Modified: 2012-06-20 09:08 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 09:08:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John Sefler 2012-03-27 13:29:53 EDT
Description of problem:
When the consumer does not have a release attribute set ("releaseVer": null), the $releasever strings in the entitled content-namespaces should not be substituted.


Version-Release number of selected component (if applicable):
[root@jsefler-r63-server ~]# rpm -q subscription-manager
subscription-manager-0.99.12-1.git.1.2b349d3.el6.x86_64


How reproducible:


Steps to Reproduce:
[root@jsefler-r63-server ~]# subscription-manager register --username testuser1 --password password --org admin
The system has been registered with id: b8ec40ab-b4d4-4603-a589-d30ca82b63fe 
[root@jsefler-r63-server ~]# subscription-manager list --avail | grep "Awesome OS with unlimited virtual guests" -A2
Product Name:         	Awesome OS with unlimited virtual guests
Product Id:           	awesomeos-virt-unlimited 
Pool Id:              	8a90f81436542b200136542c1bd70468
--
Product Name:         	Awesome OS with unlimited virtual guests
Product Id:           	awesomeos-virt-unlimited 
Pool Id:              	8a90f81436542b200136542c1bf50470
[root@jsefler-r63-server ~]# subscription-manager subscribe --pool 8a90f81436542b200136542c1bf50470
Successfully consumed a subscription from the pool with id 8a90f81436542b200136542c1bf50470.
[root@jsefler-r63-server ~]# subscription-manager release
Release not set

^^^ NOTICE THAT WE HAVE NOT SET A RELEASE

[root@jsefler-r63-server ~]# openssl x509 -text -in /etc/pki/entitlement/1443544771030459564.pem | egrep 1.3.6.1.4.1.2312.9.2\..*\.1.6 -A1
            1.3.6.1.4.1.2312.9.2.1.1.6: 
                ../foo/path/always/$releasever
--
            1.3.6.1.4.1.2312.9.2.0.1.6: 
                ../foo/path/never
--
            1.3.6.1.4.1.2312.9.2.2.1.6: 
                ../foo/path/always
--
            1.3.6.1.4.1.2312.9.2.1111.1.6: 
                ../foo/path
[root@jsefler-r63-server ~]# 

^^^ NOTICE THAT THE OID FOR PRODUCTID 1 SPECIFIES A DOWNLOAD-URL /foo/path/always/$releasever THAT INCLUDES $releasever


[root@jsefler-r63-server ~]# cat /etc/yum.repos.d/redhat.repo 
#
# Certificate-Based Repositories
# Managed by (rhsm) subscription-manager
#
# If this file is empty and this system is subscribed consider 
# a "yum repolist" to refresh available repos
#

[content-label]
name = content
baseurl = https://cdn.redhat.com/foo/path
enabled = 1
gpgcheck = 1
gpgkey = https://cdn.redhat.com/foo/path/gpg/
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/3832523306005009345-key.pem
sslclientcert = /etc/pki/entitlement/3832523306005009345.pem
metadata_expire = 0

[always-enabled-content]
name = always-enabled-content
baseurl = https://cdn.redhat.com/foo/path/always/
enabled = 1
gpgcheck = 1
gpgkey = https://cdn.redhat.com/foo/path/always/gpg
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/3832523306005009345-key.pem
sslclientcert = /etc/pki/entitlement/3832523306005009345.pem
metadata_expire = 200

[never-enabled-content]
name = never-enabled-content
baseurl = https://cdn.redhat.com/foo/path/never
enabled = 0
gpgcheck = 1
gpgkey = https://cdn.redhat.com/foo/path/never/gpg
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/3832523306005009345-key.pem
sslclientcert = /etc/pki/entitlement/3832523306005009345.pem
metadata_expire = 600


^^^ NOW NOTICE THAT THE THAT THE $releasever IS MISSING FROM THE baseurl = https://cdn.redhat.com/foo/path/always/ IN THE redhat.repo [always-enabled-content]

THIS IS A REGRESSION.

Expected:
baseurl = https://cdn.redhat.com/foo/path/always/$releasever



Additional info:
[root@jsefler-r63-server ~]# curl -k -u testuser1:password --stderr /dev/null https://jsefler-f14-candlepin:8443/candlepin/consumers/b8ec40ab-b4d4-4603-a589-d30ca82b63fe | python -m simplejson/tool | grep releaseVer
    "releaseVer": null, 
[root@jsefler-r63-server ~]#
Comment 2 William Poteat 2012-03-28 14:07:10 EDT
Master commit:

5f0e228180a37486114b429780cd501a53c64d58



No longer substitutes when no value exists [either null or empty string].

To force the changes to the redhat.repo file immediately 'yum repolist' needs to be run. This has been the case for some time now.
Comment 5 John Sefler 2012-04-10 18:58:31 EDT
Verifying Version...
[root@jsefler-r63-server ~]# rpm -q subscription-manager
subscription-manager-0.99.13-1.el6.x86_64


[root@jsefler-r63-server ~]# subscription-manager register --username testuser1 --password password --org admin
The system has been registered with id: 1ce9275e-01c6-4213-be00-12e229ffd7d3 
[root@jsefler-r63-server ~]# subscription-manager list --avail | grep "Awesome OS with unlimited virtual guests" -A2
Product Name:         	Awesome OS with unlimited virtual guests
Product Id:           	awesomeos-virt-unlimited 
Pool Id:              	8a90f814369993420136999444120468
--
Product Name:         	Awesome OS with unlimited virtual guests
Product Id:           	awesomeos-virt-unlimited 
Pool Id:              	8a90f814369993420136999444430470
[root@jsefler-r63-server ~]# subscription-manager subscribe --pool 8a90f814369993420136999444430470
Successfully consumed a subscription from the pool with id 8a90f814369993420136999444430470.
[root@jsefler-r63-server ~]# subscription-manager release
Release not set
[root@jsefler-r63-server ~]# curl -k -u testuser1:password --stderr /dev/null https://jsefler-f14-candlepin:8443/candlepin/consumers/1ce9275e-01c6-4213-be00-12e229ffd7d3 | python -m simplejson/tool | grep releaseVer
    "releaseVer": null, 


[root@jsefler-r63-server ~]# openssl x509 -text -in /etc/pki/entitlement/8815059544163451235.pem | egrep 1.3.6.1.4.1.2312.9.2\..*\.1.6 -A1
            1.3.6.1.4.1.2312.9.2.1.1.6: 
                ../foo/path/always/$releasever
--
            1.3.6.1.4.1.2312.9.2.0.1.6: 
                ../foo/path/never
--
            1.3.6.1.4.1.2312.9.2.2.1.6: 
                ../foo/path/always
--
            1.3.6.1.4.1.2312.9.2.1111.1.6: 
                ../foo/path
[root@jsefler-r63-server ~]# cat /etc/yum.repos.d/redhat.repo
#
# Certificate-Based Repositories
# Managed by (rhsm) subscription-manager
#
# If this file is empty and this system is subscribed consider 
# a "yum repolist" to refresh available repos
#

[content-label]
name = content
baseurl = https://cdn.redhat.com/foo/path
enabled = 1
gpgcheck = 1
gpgkey = https://cdn.redhat.com/foo/path/gpg/
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/8815059544163451235-key.pem
sslclientcert = /etc/pki/entitlement/8815059544163451235.pem
metadata_expire = 0

[always-enabled-content]
name = always-enabled-content
baseurl = https://cdn.redhat.com/foo/path/always/$releasever
enabled = 1
gpgcheck = 1
gpgkey = https://cdn.redhat.com/foo/path/always/gpg
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/8815059544163451235-key.pem
sslclientcert = /etc/pki/entitlement/8815059544163451235.pem
metadata_expire = 200

[never-enabled-content]
name = never-enabled-content
baseurl = https://cdn.redhat.com/foo/path/never
enabled = 0
gpgcheck = 1
gpgkey = https://cdn.redhat.com/foo/path/never/gpg
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/8815059544163451235-key.pem
sslclientcert = /etc/pki/entitlement/8815059544163451235.pem
metadata_expire = 600
[root@jsefler-r63-server ~]# subscription-manager repos --list
+----------------------------------------------------------+
    Entitled Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo Name:            	content                  
Repo Id:              	content-label            
Repo Url:             	https://cdn.redhat.com/foo/path
Enabled:              	1                        

Repo Name:            	always-enabled-content   
Repo Id:              	always-enabled-content   
Repo Url:             	https://cdn.redhat.com/foo/path/always/$releasever
Enabled:              	1                        

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

[root@jsefler-r63-server ~]# 

^^^ VERIFIED THAT A CONSUMER WITH null releaseVer DOES NOT SUBSTITUTE A VALUE FOR $releasever in the redhat.repo




______________________________________________________________________

[root@jsefler-r63-server ~]# subscription-manager release --set ""
Release set to: 
[root@jsefler-r63-server ~]# subscription-manager release
Release not set
[root@jsefler-r63-server ~]# curl -k -u testuser1:password --stderr /dev/null https://jsefler-f14-candlepin:8443/candlepin/consumers/1ce9275e-01c6-4213-be00-12e229ffd7d3 | python -m simplejson/tool | grep releaseVer
    "releaseVer": {
        "releaseVer": ""
[root@jsefler-r63-server ~]# yum -q repolist 2>/dev/null
[root@jsefler-r63-server ~]# cat /etc/yum.repos.d/redhat.repo
#
# Certificate-Based Repositories
# Managed by (rhsm) subscription-manager
#
# If this file is empty and this system is subscribed consider 
# a "yum repolist" to refresh available repos
#

[content-label]
name = content
baseurl = https://cdn.redhat.com/foo/path
enabled = 1
gpgcheck = 1
gpgkey = https://cdn.redhat.com/foo/path/gpg/
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/8815059544163451235-key.pem
sslclientcert = /etc/pki/entitlement/8815059544163451235.pem
metadata_expire = 0

[always-enabled-content]
name = always-enabled-content
baseurl = https://cdn.redhat.com/foo/path/always/$releasever
enabled = 1
gpgcheck = 1
gpgkey = https://cdn.redhat.com/foo/path/always/gpg
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/8815059544163451235-key.pem
sslclientcert = /etc/pki/entitlement/8815059544163451235.pem
metadata_expire = 200

[never-enabled-content]
name = never-enabled-content
baseurl = https://cdn.redhat.com/foo/path/never
enabled = 0
gpgcheck = 1
gpgkey = https://cdn.redhat.com/foo/path/never/gpg
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/8815059544163451235-key.pem
sslclientcert = /etc/pki/entitlement/8815059544163451235.pem
metadata_expire = 600
[root@jsefler-r63-server ~]# subscription-manager repos --list
+----------------------------------------------------------+
    Entitled Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo Name:            	content                  
Repo Id:              	content-label            
Repo Url:             	https://cdn.redhat.com/foo/path
Enabled:              	1                        

Repo Name:            	always-enabled-content   
Repo Id:              	always-enabled-content   
Repo Url:             	https://cdn.redhat.com/foo/path/always/$releasever
Enabled:              	1                        

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

[root@jsefler-r63-server ~]# 


^^^ VERIFIED THAT A CONSUMER WITH AN EMPTY STRING "" releaseVer DOES NOT SUBSTITUTE A VALUE FOR $releasever in the redhat.repo




______________________________________________________________________

[root@jsefler-r63-server ~]# subscription-manager release --set TEST_RELEASE
Release set to: TEST_RELEASE
[root@jsefler-r63-server ~]# subscription-manager release
Release: TEST_RELEASE
[root@jsefler-r63-server ~]# curl -k -u testuser1:password --stderr /dev/null https://jsefler-f14-candlepin:8443/candlepin/consumers/1ce9275e-01c6-4213-be00-12e229ffd7d3 | python -m simplejson/tool | grep releaseVer
    "releaseVer": {
        "releaseVer": "TEST_RELEASE"
[root@jsefler-r63-server ~]# yum -q repolist 2>/dev/null
[root@jsefler-r63-server ~]# cat /etc/yum.repos.d/redhat.repo
#
# Certificate-Based Repositories
# Managed by (rhsm) subscription-manager
#
# If this file is empty and this system is subscribed consider 
# a "yum repolist" to refresh available repos
#

[content-label]
name = content
baseurl = https://cdn.redhat.com/foo/path
enabled = 1
gpgcheck = 1
gpgkey = https://cdn.redhat.com/foo/path/gpg/
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/8815059544163451235-key.pem
sslclientcert = /etc/pki/entitlement/8815059544163451235.pem
metadata_expire = 0

[always-enabled-content]
name = always-enabled-content
baseurl = https://cdn.redhat.com/foo/path/always/TEST_RELEASE
enabled = 1
gpgcheck = 1
gpgkey = https://cdn.redhat.com/foo/path/always/gpg
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/8815059544163451235-key.pem
sslclientcert = /etc/pki/entitlement/8815059544163451235.pem
metadata_expire = 200

[never-enabled-content]
name = never-enabled-content
baseurl = https://cdn.redhat.com/foo/path/never
enabled = 0
gpgcheck = 1
gpgkey = https://cdn.redhat.com/foo/path/never/gpg
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/8815059544163451235-key.pem
sslclientcert = /etc/pki/entitlement/8815059544163451235.pem
metadata_expire = 600
[root@jsefler-r63-server ~]# subscription-manager repos --list
+----------------------------------------------------------+
    Entitled Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo Name:            	content                  
Repo Id:              	content-label            
Repo Url:             	https://cdn.redhat.com/foo/path
Enabled:              	1                        

Repo Name:            	always-enabled-content   
Repo Id:              	always-enabled-content   
Repo Url:             	https://cdn.redhat.com/foo/path/always/TEST_RELEASE
Enabled:              	1                        

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

[root@jsefler-r63-server ~]# 


^^^ VERIFIED THAT A CONSUMER WITH AN NON-NULL/NON-EMPTY STRING releaseVer DOES SUBSTITUTE A VALUE FOR $releasever in the redhat.repo




Moving to VERIFIED
Comment 7 errata-xmlrpc 2012-06-20 09:08:28 EDT
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.

http://rhn.redhat.com/errata/RHBA-2012-0804.html

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