]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/tox: handle possible WITH_PYTHON3 values other than "3" 27884/head
authorNathan Cutler <ncutler@suse.com>
Tue, 7 May 2019 12:10:56 +0000 (14:10 +0200)
committerNathan Cutler <ncutler@suse.com>
Wed, 29 May 2019 11:40:30 +0000 (13:40 +0200)
WITH_PYTHON3 might be set to "ON" or to the python3 RPM version number
prevailing on the system - e.g. "3", "36"

Fixes: 9426f1f2045d0ae0f319530c3dc3a9240d838d07
Signed-off-by: Nathan Cutler <ncutler@suse.com>
(cherry picked from commit f8aac6f69b2d5e28f428e9f7a64beac5878452ff)

src/pybind/mgr/ansible/run-tox.sh
src/pybind/mgr/dashboard/run-tox.sh
src/pybind/mgr/insights/run-tox.sh
src/pybind/mgr/orchestrator_cli/run-tox.sh

index f2eecd85fe1cb45cc405957661763e617d114114..fd6da244cb684e697560e10f744228c64ec8b25f 100644 (file)
@@ -29,7 +29,9 @@ source ${MGR_ANSIBLE_VIRTUALENV}/bin/activate
 if [ "$WITH_PYTHON2" = "ON" ]; then
   ENV_LIST+="py27,"
 fi
-if [ "$WITH_PYTHON3" = "3" ]; then
+# WITH_PYTHON3 might be set to "ON" or to the python3 RPM version number
+# prevailing on the system - e.g. "3", "36"
+if [[ "$WITH_PYTHON3" =~ (^3|^ON) ]]; then
   ENV_LIST+="py3,"
 fi
 # use bash string manipulation to strip off any trailing comma
index 27c585140540239e1dc739ac753b5b667384c04c..35be81c86d75e6d1e291927a1c4656b0ab94ca80 100755 (executable)
@@ -33,7 +33,9 @@ if [ "$WITH_PYTHON2" = "ON" ]; then
     ENV_LIST+="py27-cov,py27-lint,"
   fi
 fi
-if [ "$WITH_PYTHON3" = "3" ]; then
+# WITH_PYTHON3 might be set to "ON" or to the python3 RPM version number
+# prevailing on the system - e.g. "3", "36"
+if [[ "$WITH_PYTHON3" =~ (^3|^ON) ]]; then
   if [[ -n "$@" ]]; then
     ENV_LIST+="py3-run,"
   else
index 9a2c400f797c4ad7486e481b3b7246818e849a8a..7d62145092dc625881007d48c7f527850de6732a 100644 (file)
@@ -29,7 +29,9 @@ source ${MGR_INSIGHTS_VIRTUALENV}/bin/activate
 if [ "$WITH_PYTHON2" = "ON" ]; then
   ENV_LIST+="py27,"
 fi
-if [ "$WITH_PYTHON3" = "3" ]; then
+# WITH_PYTHON3 might be set to "ON" or to the python3 RPM version number
+# prevailing on the system - e.g. "3", "36"
+if [[ "$WITH_PYTHON3" =~ (^3|^ON) ]]; then
   ENV_LIST+="py3,"
 fi
 # use bash string manipulation to strip off any trailing comma
index 6a1a34186419de6ed4214dbb700ea3d5f20a357c..32b24f5525f335dd0fbc218f165e286efb86182b 100644 (file)
@@ -32,11 +32,11 @@ fi
 if [ "$WITH_PYTHON2" = "ON" ]; then
   ENV_LIST+="py27,"
 fi
-if [ "$WITH_PYTHON3" = "3" ]; then
+# WITH_PYTHON3 might be set to "ON" or to the python3 RPM version number
+# prevailing on the system - e.g. "3", "36"
+if [[ "$WITH_PYTHON3" =~ (^3|^ON) ]]; then
   ENV_LIST+="py3,"
 fi
-ENV_LIST=$(echo "$ENV_LIST" | sed -e 's/,$//')
-
 # use bash string manipulation to strip off any trailing comma
 ENV_LIST=${ENV_LIST%,}