Rally bash completion doesnt exist in a virtualenv

Bug #1461336 reported by Imran Hayder
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Rally
Fix Released
High
Sergey Skripnick

Bug Description

OVERVIEW:
When trying to install latest master branch of rally as following:

$ ./install_rally.sh -v -y --target $WORKSPACE/rally-install

it installs everything successfully.. but fails upon :

`source $WORKSPACE/rally-install/bin/activate `

DETAILS:
I am installing rally using jenkins, and in jenkins $WORKSPACE is automatically set for each job , which is the pwd of that job dir .
using above commands, i was installing rally in separate virtualenv, but it failed at activating the virtualenv complaining :

====================
. /var/lib/jenkins/workspace/rally_experiment/rally-install/etc/bash_completion.d/rally.bash_completion
/var/lib/jenkins/workspace/rally_experiment/rally-install/bin/activate: line 82: /var/lib/jenkins/workspace/rally_experiment/rally-install/etc/bash_completion.d/rally.bash_completion: No such file or directory

 Build step 'Execute shell' marked build as failure
====================

Now upon inspecting the 'install_rally.sh" script, i saw this:

~~~~~~~~~~~~~~~~
# Post-installation
if [ "$USEVIRTUALENV" = 'yes' ]
then
    # Fix bash_completion
. "$VENVDIR/etc/bash_completion.d/rally.bash_completion"
__EOF__

    cat <<__EOF__
~~~~~~~~~~~~~~~~~~

this just looks plain wrong, reason being::

1) who is copying the rally bash completion to virtualenv dir and where ????
2) the pip virtualenv doesnt even create 'etc` dir ,, let alone ` bash_completion.d ` .

SOLUTIONS:
i temporarily worked around with this :
`````````
# Post-installation
if [ "$USEVIRTUALENV" = 'yes' ]
then
    # Fix bash_completion
    mkdir -p "$VENVDIR"/etc/bash_completion.d && cp -r etc/rally.bash_completion "$VENVDIR"/etc/bash_completion.d/
    cat >> "$VENVDIR"/bin/activate <<__EOF__

. "$VENVDIR/etc/bash_completion.d/rally.bash_completion"
__EOF__

    cat <<__EOF__
```````````

Tags: rally
Changed in rally:
assignee: nobody → Sergey Skripnick (eyerediskin)
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to rally (master)

Fix proposed to branch: master
Review: https://review.openstack.org/188748

Changed in rally:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to rally (master)

Reviewed: https://review.openstack.org/188748
Committed: https://git.openstack.org/cgit/openstack/rally/commit/?id=e8fbd0d2a1ee71d328bf1ed32e8b84216e409230
Submitter: Jenkins
Branch: master

commit e8fbd0d2a1ee71d328bf1ed32e8b84216e409230
Author: Sergey Skripnick <email address hidden>
Date: Fri Jun 5 14:29:44 2015 +0300

    Use absoulote path to venv in installation script

    Activation script should work when called from any directory.
    Closes-Bug: 1461336

    Change-Id: I5aa3699d48ebe2735d273791888826edd4878c64

Changed in rally:
status: In Progress → Fix Committed
Changed in rally:
milestone: none → 0.1.0
Changed in rally:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.