Fixes python version to be 2.7 for lab-reconfig scripts 60/1060/1
authorTim Rozet <trozet@redhat.com>
Thu, 23 Jul 2015 21:34:14 +0000 (17:34 -0400)
committerTim Rozet <trozet@redhat.com>
Thu, 23 Jul 2015 21:34:14 +0000 (17:34 -0400)
JIRA: OCTO-109

Change-Id: I87535d0f786a90776a0fc0e1f3964f110a7a74a6
Signed-off-by: Tim Rozet <trozet@redhat.com>
utils/lab-reconfiguration/create_venv.sh

index 19d9b49..4e45f84 100755 (executable)
@@ -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