summaryrefslogtreecommitdiffstats
path: root/scripts/find_python.sh
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-03-24 20:00:27 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2016-03-24 20:00:27 +0200
commit59f00264f39dfb95a62401776b4ed8c433682fa7 (patch)
tree96b5411f17faed9f62aa9e4722b29d767d502b1b /scripts/find_python.sh
parent4e8ce34a9ef6b8883cfed47f77c9b753e1cf4248 (diff)
gather stateful client to stf folder, create trex_client package
Diffstat (limited to 'scripts/find_python.sh')
-rwxr-xr-xscripts/find_python.sh27
1 files changed, 21 insertions, 6 deletions
diff --git a/scripts/find_python.sh b/scripts/find_python.sh
index 929e873d..e9607fe5 100755
--- a/scripts/find_python.sh
+++ b/scripts/find_python.sh
@@ -24,12 +24,27 @@ function find_python {
exit -1
}
-if [ -z "$PYTHON" ]; then
- # for development here - move us to python 3 for now
- if [ "$USER" == "imarom" ] || [ "$USER" == "hhaim" ] || [ "$USER" == "ybrustin" ] || [ "$USER" == "ibarnea" ]; then
- PYTHON=/auto/proj-pcube-b/apps/PL-b/tools/python3.4/bin/python3
- else
- find_python
+function find_python3 {
+ MACHINE_PYTHON=python3
+ ITAY_PYTHON=/auto/proj-pcube-b/apps/PL-b/tools/python3.4/bin/python3
+ PYTHON3=$MACHINE_PYTHON
+ PCHECK=`$PYTHON3 -c "import sys; ver = sys.version_info[0] * 10 + sys.version_info[1];sys.exit(ver != 34)"`
+ if [ $? -eq 0 ]; then
+ return
+ fi
+ PYTHON3=$ITAY_PYTHON
+ PCHECK=`$PYTHON3 -c "import sys; ver = sys.version_info[0] * 10 + sys.version_info[1];sys.exit(ver != 34)"`
+ if [ $? -eq 0 ]; then
+ return
fi
+ echo "*** $PYTHON3 - python version does not match, 3.4 is required"
+ exit -1
+}
+
+if [ -z "$PYTHON" ]; then
+ find_python
fi
+if [ -z "$PYTHON3" ]; then
+ find_python3
+fi