Ignore stderr when checking for Python version
https://review.openstack.org/504171 prevented Python version detection
from failing when python3 is not installed. However, "which python3"
returns a message in stderr when python3 is not there, and this output
can make diskimage-builder get confused when parsing
source-repository-images.
Change-Id: Idb649dc341ede73c39954b0432ef3cacf379ed37
diff --git a/functions-common b/functions-common
index 283a6cf..e53c72d 100644
--- a/functions-common
+++ b/functions-common
@@ -2081,7 +2081,7 @@
local interp=$1
local version
# disable erroring out here, otherwise if python 3 doesn't exist we fail hard.
- if [[ -x $(which $interp) ]]; then
+ if [[ -x $(which $interp 2> /dev/null) ]]; then
version=$($interp -c 'import sys; print("%s.%s" % sys.version_info[0:2])')
fi
echo ${version}