Bug 1277707 - Binaries for customer installed gems will not be found
Summary: Binaries for customer installed gems will not be found
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Build
Version: 5.5.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.5.0
Assignee: Joe Vlcek
QA Contact: Pete Savage
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-03 21:23 UTC by Joe Vlcek
Modified: 2015-12-08 13:43 UTC (History)
8 users (show)

Fixed In Version: 5.5.0.11
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-12-08 13:43:33 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:2551 0 normal SHIPPED_LIVE Moderate: CFME 5.5.0 bug fixes and enhancement update 2015-12-08 17:58:09 UTC

Description Joe Vlcek 2015-11-03 21:23:37 UTC
Description of problem:

If a customer installs a ruby gem that contains binaries the binaries
will not be found in $PATH

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Boot a CFME appliance.
2. % cd /var/www/miq/vmdb
3. % gem install <any gem that contains a binary>
   e.g.: % gem install gempath
4. % which gempath
   /usr/bin/which: no gempath in<... BLA BLA BLA>

Actual results:

Binary was not found in $PATH

Expected results:

The binary included in the installed gem should be found in $PATH

Additional info:

Work around is to update $PATH as follows:

1. % PATH=$PATH:/opt/rh/rh-ruby22/root/usr/local/bin/
2. % which gempath
   /opt/rh/rh-ruby22/root/usr/local/bin/gempath

3. % gempath ovirt
   /opt/rh/cfme-gemset/gems/ovirt-0.6.0


The fix is to upate PATH in the enable script when it is created
in the RPM spec for cfme-gemset.

On appliance see:
 /opt/rh/cfme-gemset/enable

Comment 2 Jason Frey 2015-11-17 17:52:52 UTC
JoeV is writing a fix into the cfme-gemset enable script to add /opt/rh/rh-ruby22/root/usr/local/bin to the PATH, which should solve this issue.

However, the real problem is in the SCL, as *that* package should be adding that to the PATH.  I am going to open a separate ticket with them to get that added.

Comment 3 Joe Vlcek 2015-11-17 18:47:50 UTC
The diff to the cfme-gemset.spec:

diff --git a/cfme-gemset.spec b/cfme-gemset.spec
index c108356..4b75bfc 100644
--- a/cfme-gemset.spec
+++ b/cfme-gemset.spec
@@ -2,7 +2,7 @@
 
 Name:      cfme-gemset
 Version:   5.5.0.10
-Release:   beta2.1.1%{?dist}
+Release:   beta2.1.2%{?dist}
 Summary:   CloudForms Management Engine Gemset
 Group:     Applications/System
 License:   "GPLv2+, Apache Public License 2.0, The MIT License and Ruby License"
@@ -20,7 +20,7 @@ cat <<"EOF" > enable
 export APPLIANCE="true"
 export BUNDLE_PATH=/opt/rh/cfme-gemset
 export GEM_PATH=/opt/rh/cfme-gemset:$(gem env path)
-export PATH=/opt/rh/cfme-gemset/bin:$PATH
+export PATH=/opt/rh/cfme-gemset/bin:$PATH:/opt/rh/rh-ruby22/root/usr/local/bin/
 
 [[ -f /var/www/miq/vmdb/Gemfile.lock ]] && rm -f /var/www/miq/vmdb/Gemfile.lock
 ln -s /opt/rh/cfme-gemset/vmdb/Gemfile.lock /var/www/miq/vmdb/Gemfile.lock
@@ -66,6 +66,9 @@ rm -rf $RPM_BUILD_ROOT
 %{app_root}/enable
 
 %changelog
+* Tue Nov 17 2015 Joe VLcek <jvlcek> - 5.5.0.10-beta2.1.2
+- Updated enable script to include /opt/rh/rh-ruby22/root/usr/local/bin/ in PATH
+
 * Tue Nov 10 2015 Satoe Imaishi <simaishi> - 5.5.0.10-beta2.1.1
 - Building 5.5.0.10 beta2.1.1

Comment 5 Joe Vlcek 2015-11-17 20:12:42 UTC
Note to QE for how to test this fix:

1. Boot and log into a CFME appliance.
2. % cd /var/www/miq/vmdb
3. % gem install <any gem that contains an executable>
   e.g.: % gem install gempath

   The gempath gem happens to contain an executable with the same name.

4. Use the linux which(1) command to display the path to the executable
   included in the gem.
   e.g.: % which gempath

5. Invoke the executable included in the installed gem:
   e.g.: gempath rake

If steps 4 and 5 are successful the fix is working.

6. Run the full suite of CFME tests against this appliance to confirm
   this fix did not adversely effect the appliance.

Comment 6 Pete Savage 2015-11-20 14:26:19 UTC
Verified in 5.5.0.11

Comment 8 errata-xmlrpc 2015-12-08 13:43:33 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/RHSA-2015:2551


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