Bug 1001459 - post script will throw error message when upgrading rubygem-openshift-origin-auth-remote-user and auth plugin config file is not named to "openshift-origin-auth-remote-user.conf"
post script will throw error message when upgrading rubygem-openshift-origin-...
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Pod (Show other bugs)
1.2.1
Unspecified Unspecified
low Severity low
: ---
: ---
Assigned To: Miciah Dashiel Butler Masters
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-27 02:03 EDT by Johnny Liu
Modified: 2017-03-08 12 EST (History)
4 users (show)

See Also:
Fixed In Version: rubygem-openshift-origin-auth-remote-user-1.8.3-1
Doc Type: Bug Fix
Doc Text:
When upgrading rubygem-openshift-origin-auth-remote-user, error messages were displayed if the configuration file of the Remote User authentication plug-in was not in the default location. This could occur if the plug-in was not enabled or if the configuration file was named differently. This issue has been fixed in the current release of OpenShift Enterprise.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-25 11:30:47 EDT
Type: Bug
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 Johnny Liu 2013-08-27 02:03:32 EDT
Description of problem:
Found this issue during tps-rpm test.

Currently auth plugin config file could be named to any, just make sure the config file has ".conf" suffix should be ok.

# rpm -qp --scripts rubygem-openshift-origin-auth-remote-user-1.8.2-1.el6op.noarch.rpm
postinstall scriptlet (using /bin/sh):

if [ $1 -ne 1 ] # this is an update; fix the previously configured realm.
then
  sed -i -e 's/AuthName.*/AuthName "OpenShift Broker API"/' /var/www/openshift/broker/httpd/conf.d/openshift-origin-auth-remote-user.conf
fi

Now issue comes, if user has auth config file named "xxx.conf", then update rubygem-openshift-origin-auth-remote-user package using "rpm -Uhv", it will throw the following error message:
# rpm -Uhv rubygem-openshift-origin-auth-remote-user-1.8.2-1.el6op.noarch.rpm
sed: can't read /var/www/openshift/broker/httpd/conf.d/openshift-origin-auth-remote-user.conf: No such file or directory
warning: %post(rubygem-openshift-origin-auth-remote-user-1.8.2-1.el6op.noarch) scriptlet failed, exit status 2

Version-Release number of selected component (if applicable):
rubygem-openshift-origin-auth-remote-user-1.8.2-1.el6op.noarch.rpm

How reproducible:
Always

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Comment 2 Miciah Dashiel Butler Masters 2013-08-27 06:12:20 EDT
We need to backport https://github.com/openshift/origin-server/commit/d2e35f26571065963f2294d2b5a0881059ce9e0a
Comment 3 Miciah Dashiel Butler Masters 2013-09-09 21:54:39 EDT
Pull request:   https://github.com/openshift/enterprise-server/pull/135

This is direct cherry-picking of the commit mentioned in comment 2, but in light of bug 999182, should we try to be a little more clever in case the .conf file has a different name?
Comment 4 Brenton Leanhardt 2013-09-10 08:56:05 EDT
I'm OK will keeping the filename guessing logic in oo-diagnostics and keeping the %post logic the same as upstream.
Comment 7 Johnny Liu 2013-09-13 01:54:47 EDT
Verified this bug with rubygem-openshift-origin-auth-remote-user-1.8.3-1.el6op.noarch, and PASS.

# rpm -Uhv rubygem-openshift-origin-auth-remote-user-1.8.3-1.el6op.noarch.rpm 
Preparing...                ########################################### [100%]
   1:rubygem-openshift-origi########################################### [100%]
Comment 10 errata-xmlrpc 2013-09-25 11:30:47 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-2013-1275.html

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