summaryrefslogtreecommitdiffstats
path: root/scripts/stl-sim
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-03-27 19:06:48 +0300
committerYaroslav Brustinov <ybrustin@cisco.com>2016-03-27 19:06:48 +0300
commit68ed79b989008006897108c7978d5c65fef47711 (patch)
tree43ed82b63015777369e8db71ca247f512a9de467 /scripts/stl-sim
parentfbf1d1f4387566e964b2775e79e4e71c87dc3f8d (diff)
fix find_python usage
Diffstat (limited to 'scripts/stl-sim')
-rwxr-xr-xscripts/stl-sim18
1 files changed, 16 insertions, 2 deletions
diff --git a/scripts/stl-sim b/scripts/stl-sim
index 57fe4fa8..198d1275 100755
--- a/scripts/stl-sim
+++ b/scripts/stl-sim
@@ -1,6 +1,20 @@
#!/bin/bash
-source find_python.sh
+INPUT_ARGS=$@
+
+if [[ $@ =~ '--python2' ]]; then
+ INPUT_ARGS=${@//--python2/}
+ source find_python.sh --python2
+fi
+
+if [[ $@ =~ '--python3' ]]; then
+ INPUT_ARGS=${@//--python3/}
+ source find_python.sh --python3
+fi
+
+if [ -z "$PYTHON" ]; then
+ source find_python.sh
+fi
export PYTHONPATH=automation/trex_control_plane/stl
-$PYTHON -m trex_stl_lib.trex_stl_sim -p $PWD $@
+$PYTHON -m trex_stl_lib.trex_stl_sim -p $PWD $INPUT_ARGS