summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Short <ekultails@gmail.com>2020-12-15 11:30:21 -0700
committerShnaidman Sagi (Sergey) <sshnaidm@redhat.com>2021-08-18 14:11:10 +0000
commit98fade887a8d691080b607c4e43be30e6bd3311a (patch)
tree3ac1dde482a90207d19e6172c97b4f3ec6bbf4f4
parent0833daa3f77dd2267a6068eeafcf9d9af8da1a17 (diff)
downloadheat-98fade887a8d691080b607c4e43be30e6bd3311a.tar.gz
Detect EL8 platform-python
Otherwise, this script fails to run on Enterprise Linux 8 distros. Change-Id: I0168b380d0e201d9c8f8121b384d25a2412c2129 Signed-off-by: Luke Short <ekultails@gmail.com> (cherry picked from commit 2d692e22f42bc64476ab01ff7e8c4d4717ef3786)
-rwxr-xr-xheat/cloudinit/loguserdata.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/heat/cloudinit/loguserdata.py b/heat/cloudinit/loguserdata.py
index e02a59bae..413f3a758 100755
--- a/heat/cloudinit/loguserdata.py
+++ b/heat/cloudinit/loguserdata.py
@@ -16,8 +16,17 @@
# but pkg_resources can't be imported.
echo "import pkg_resources" | python3 2>/dev/null
has_py3=$?
+echo "import pkg_resources" | python2 2>/dev/null
+has_py2=$?
+echo "import pkg_resources" | /usr/libexec/platform-python 2>/dev/null
+has_platform-py=$?
+
if [ $has_py3 = 0 ]; then
interpreter="python3"
+elif [ $has_py2 = 0 ]; then
+ interpreter="python"
+elif [ $has_platform-py = 0 ]; then
+ interpreter="/usr/libexec/platform-python"
else
interpreter="python"
fi