Bug 1031490

Summary: [brandbot] Should ignore anything except the first line of /var/lib/rhsm/branded_name while updating /etc/os-release file
Product: Red Hat Enterprise Linux 7 Reporter: Rehana <redakkan>
Component: initscriptsAssignee: initscripts Maintenance Team <initscripts-maint-list>
Status: CLOSED CURRENTRELEASE QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: jscotka, jsefler, lnykryn, rvokal, spandey
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: initscripts-9.49.12-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 12:34:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 863175, 909224    

Description Rehana 2013-11-18 05:54:57 UTC
Description of problem:
During the test , observed the /etc/os-release file was updated with all the contents(multiple lines of data) of branded_name file,but the contents in the branded_name file was updated with
the product name after the next cert update, but /etc/os-release file
continued to display the old data as well

Version-Release number of selected component (if applicable):
 rpm -qa | grep initscripts
initscripts-9.49.7-1.el7.x86_64

subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.8.33-1
subscription-manager: 1.10.7-1.el7
python-rhsm: 1.10.6-1.el7

How reproducible:
3/3


Steps to Reproduce:
1. Manually added a new line "testing new line of data" in branded_file name
 
[root@dhcp70-124 product]# cat /var/lib/rhsm/branded_name
Awesome OS Server Bits
testing new line of data

2.[root@dhcp70-124 product]# cat /etc/os-release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.0 (Maipo)"
ID="rhel"
VERSION_ID="7.0"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.0:beta:server"
 
REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.0
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION=7.0
PRETTY_NAME="Awesome OS Server Bits
testing new line of data"

3. DO any cert update operations like removing subscription, add a new subscription etc

I did a cli attach to trigger the entitlement cert update, to update the branded_name file content
[root@dhcp70-124 product]# subscription-manager attach --pool 8ac6a362425a296701425a29d24507c9
Successfully attached a subscription for: RAM Limiting Package (4GB stackable)

4.the branded_name file is updated with the installed product name , the new line was removed from the branded_name file

[root@dhcp70-124 product]# cat /var/lib/rhsm/branded_name
Awesome OS Server Bits

5.But the /etc/os-release file continued to display the newline details, which wasnt there in the branded_name file after the cert update
[root@dhcp70-124 product]# cat /etc/os-release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.0 (Maipo)"
ID="rhel"
VERSION_ID="7.0"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.0:beta:server"
 
REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.0
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION=7.0
PRETTY_NAME="Awesome OS Server Bits"
testing new line of data"  <<<<======previous content

***here is the subscription-manger log details on branded_name update*******
2013-11-15 01:24:49,424 [DEBUG] subscription-manager @rhelentbranding.py:119 - Installed branded product: <rhsm.certificate2.Product object at 0x24d6810>
2013-11-15 01:24:49,424 [DEBUG] subscription-manager @rhelentbranding.py:122 - 1 entitlement certs with brand info found
2013-11-15 01:24:49,424 [DEBUG] subscription-manager @entbranding.py:61 - Current branded name info, if any: Awesome OS Server Bits
testing new line of data
2013-11-15 01:24:49,425 [DEBUG] subscription-manager @entbranding.py:62 - Fresh ent cert has branded product info: Awesome OS Server Bits
2013-11-15 01:24:49,425 [INFO] subscription-manager @rhelentbranding.py:43 - Updating product branding info for: Awesome OS Server Bits
2013-11-15 01:24:49,453 [INFO] subscription-manager @cache.py:168 - Checking current system info against cache: /var/lib/rhsm/cache/installed_products.json
2013-11-15 01:24:49,453 [INFO] subscription-manager @cache.py:185 - No changes.

Actual results:
Here the new line of data in the branded_name file was updated with
the product name after the cert update, but /etc/os-release file
continued to display newline data(Previous).

Expected results:
SHOULD ignore anything except the first line of /var/lib/rhsm/branded_name as per https://docspace-old.corp.redhat.com/docs/DOC-153859

Additional info:
Note:
As discussed with Bill Nottingham logging Brandbot related bugs against "initscripts" component

Comment 2 Rehana 2014-01-06 10:51:20 UTC
Retested on 

subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.9.1-1
subscription-manager: 1.10.8-1.el7
python-rhsm: 1.10.8-1.el7

rpm -qa | grep initscripts
initscripts-9.49.12-1.el7.x86_64


Observed that now only the first line of branded_name file content is updated in the /etc/os-release  file

cat /etc/os-release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.0 (Maipo)"
ID="rhel"
VERSION_ID="7.0"
PRETTY_NAME="Awesome OS Server Bits"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.0:beta:server"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.0
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION=7.0

Comment 3 Ludek Smid 2014-06-13 12:34:29 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.