Bug 1377315

Summary: When the client configuration RPM is being installed, "enabled = 0" appears in the output
Product: Red Hat Update Infrastructure for Cloud Providers Reporter: Radek Bíba <rbiba>
Component: ToolsAssignee: bizhang
Status: CLOSED ERRATA QA Contact: Radek Bíba <rbiba>
Severity: low Docs Contact:
Priority: low    
Version: 3.0.0CC: bizhang, igulina, pcreech
Target Milestone: ---Keywords: EasyFix
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-01 22:13:18 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:

Description Radek Bíba 2016-09-19 12:31:05 UTC
Description of problem:
SSIA.

Version-Release number of selected component (if applicable):
rh-rhui-tools-pre.3.0.21-1.el7ui (August 2016 ISOs)

How reproducible:
Always

Steps to Reproduce:
1. Create a client configuration RPM in rhui-manager.
2. Copy it to a client machine and install it.

Actual results:
# rpm -ihv PATH.rpm 
Preparing...                ########################################### [100%]
   1:NAME                   ########################################### [100%]
enabled = 0

Expected results:
"enabled = 0" isn't shown. Such a piece of information can be confusing.

Additional info:
This is caused by the %post script of the configuration RPM, which reads:

if [ "$1" = "1" ]; then  # 'install', not 'upgrade'
  # Disable RHN plugin
  if [ -f /etc/yum/pluginconf.d/rhnplugin.conf ]; then
   grep -iP "enabled = (0|false|off)"  /etc/yum/pluginconf.d/rhnplugin.conf  || sed -i.save -e 's/^enabled.*/enabled = 0/g' /etc/yum/pluginconf.d/rhnplugin.conf || :
  fi
fi

Can you add "q" to the list of grep options to make the command quiet?

Comment 2 Radek Bíba 2016-12-07 14:16:53 UTC
Fix confirmed in 20161206:

[root@ip-10-100-145-137 ~]# rpm -ihv /tmp/rhuimrg-5-1.noarch.rpm 
Preparing...                ########################################### [100%]
   1:rhuimrg                ########################################### [100%]
[root@ip-10-100-145-137 ~]#

(Resolved by calling "grep -iPq ...".)

Comment 3 errata-xmlrpc 2017-03-01 22:13:18 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:0367