From 0e3af9d49a9249a59ec85c9a57b63804bca6facc Mon Sep 17 00:00:00 2001 From: Tim Rozet Date: Thu, 23 Jul 2015 17:34:14 -0400 Subject: Fixes python version to be 2.7 for lab-reconfig scripts JIRA: OCTO-109 Change-Id: I87535d0f786a90776a0fc0e1f3964f110a7a74a6 Signed-off-by: Tim Rozet --- utils/lab-reconfiguration/create_venv.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'utils') 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 -- cgit 1.2.3-korg