Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
LukeShortCloud committed Dec 15, 2020
1 parent a50afeb commit 2d692e2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions heat/cloudinit/loguserdata.py
Expand Up @@ -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
Expand Down

0 comments on commit 2d692e2

Please sign in to comment.