Safety check for python version in get_pip_command
We know empirically that some legacy gate jobs pass and appear
to be running with python3 but actually pip was invoked with
PYTHON3_VERSION unset so that they are actually ran with python2
packages.
As a followup to this discussion [1], add a safety check in the
get_pip_command function to ensure that a python version has been
set when it is invoked.
[1] https://review.openstack.org/#/c/622415/4/inc/python@283
Change-Id: I3a08406fb7d68282c6b98abb33a625821510046a
diff --git a/inc/python b/inc/python
index 19e1228..0e575ae 100644
--- a/inc/python
+++ b/inc/python
@@ -29,6 +29,10 @@
# get_pip_command
function get_pip_command {
local version="$1"
+ if [ -z "$version" ]; then
+ die $LINENO "pip python version is not set."
+ fi
+
# NOTE(dhellmann): I don't know if we actually get a pip3.4-python
# under any circumstances.
which pip${version} || which pip${version}-python