summaryrefslogtreecommitdiffstats
path: root/utils/lab-reconfiguration
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2015-07-23 17:34:14 -0400
committerTim Rozet <trozet@redhat.com>2015-07-23 17:34:14 -0400
commit0e3af9d49a9249a59ec85c9a57b63804bca6facc (patch)
treee88bd3caa3920232dfa4984a79e29495bbc25f35 /utils/lab-reconfiguration
parent936c70f3b273b1a50660e5c53f274f5d9d6727be (diff)
Fixes python version to be 2.7 for lab-reconfig scripts
JIRA: OCTO-109 Change-Id: I87535d0f786a90776a0fc0e1f3964f110a7a74a6 Signed-off-by: Tim Rozet <trozet@redhat.com>
Diffstat (limited to 'utils/lab-reconfiguration')
-rwxr-xr-xutils/lab-reconfiguration/create_venv.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/utils/lab-reconfiguration/create_venv.sh b/utils/lab-reconfiguration/create_venv.sh
index 19d9b49c4..4e45f8462 100755
--- a/utils/lab-reconfiguration/create_venv.sh
+++ b/utils/lab-reconfiguration/create_venv.sh
@@ -7,11 +7,11 @@ BASEDIR=`dirname $0`
function venv_install() {
if command -v virtualenv-2.7; then
- virtualenv-2.7 $1
+ virtualenv-2.7 -p python2.7 $1
elif command -v virtualenv2; then
- virtualenv2 $1
+ virtualenv2 -p python2.7 $1
elif command -v virtualenv; then
- virtualenv $1
+ virtualenv -p python2.7 $1
else
echo Cannot find virtualenv command.
return 1
@@ -25,6 +25,11 @@ if [ ! -d "$BASEDIR/venv" ]; then
echo "Virtualenv created."
fi
+if [[ ! $(rpm -qa | grep python-2.7) ]]; then
+ echo "Python 2.7 not found, but required...attempting to install"
+ sudo yum install -y python-2.7*
+fi
+
if [ ! -f "$BASEDIR/venv/updated" -o $BASEDIR/requirements.pip -nt $BASEDIR/venv/updated ]; then
source $BASEDIR/venv/bin/activate
pip install -r $BASEDIR/requirements.pip