Skip to content

Commit

Permalink
pybind/tox: handle possible WITH_PYTHON3 values other than "3"
Browse files Browse the repository at this point in the history
WITH_PYTHON3 might be set to "ON" or to the python3 RPM version number
prevailing on the system - e.g. "3", "36"

Fixes: 9426f1f
Signed-off-by: Nathan Cutler <ncutler@suse.com>
(cherry picked from commit f8aac6f)
  • Loading branch information
smithfarm committed May 29, 2019
1 parent 63c045d commit b9049a0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/pybind/mgr/ansible/run-tox.sh
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/pybind/mgr/dashboard/run-tox.sh
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/pybind/mgr/insights/run-tox.sh
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/pybind/mgr/orchestrator_cli/run-tox.sh
Expand Up @@ -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%,}

Expand Down

0 comments on commit b9049a0

Please sign in to comment.