Skip to content

Commit b51a76d

Browse files
Merge pull request #337 from chef-partners/ayush/update-in-shared-file
Fix for failing deployment of Azure Chef extension in Ubuntu 20.04
2 parents d78ed24 + fa31824 commit b51a76d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ChefExtensionHandler/bin/shared.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
get_linux_distributor(){
44
#### Using python -mplatform command to get distributor name #####
5-
if ( python -mplatform || /usr/libexec/platform-python -mplatform ) | grep centos > /dev/null; then
5+
if ( python -mplatform || /usr/libexec/platform-python -mplatform || cat /etc/os-release) | grep centos > /dev/null; then
66
linux_distributor='centos'
7-
elif ( python -mplatform || /usr/libexec/platform-python -mplatform ) | grep Ubuntu > /dev/null; then
7+
elif ( python -mplatform || cat /etc/os-release ) | grep Ubuntu > /dev/null; then
88
linux_distributor='ubuntu'
9-
elif ( python -mplatform || /usr/libexec/platform-python -mplatform ) | grep debian > /dev/null; then
9+
elif ( python -mplatform || cat /etc/os-release ) | grep debian > /dev/null; then
1010
linux_distributor='debian'
11-
elif ( python -mplatform || /usr/libexec/platform-python -mplatform ) | grep redhat > /dev/null; then
11+
elif ( python -mplatform || /usr/libexec/platform-python -mplatform || cat /etc/os-release ) | grep redhat > /dev/null; then
1212
linux_distributor='rhel'
13-
elif ( python -mplatform || /usr/libexec/platform-python -mplatform ) | grep -E -i "linux.*oracle" > /dev/null; then
13+
elif ( python -mplatform || /usr/libexec/platform-python -mplatform || cat /etc/os-release ) | grep -E -i "linux.*oracle" > /dev/null; then
1414
linux_distributor='linuxoracle'
1515
fi
1616
echo "${linux_distributor}"
@@ -108,8 +108,8 @@ get_file_path_to_parse_env_variables(){
108108
# Execute parse_env_variables.py file to fetch values of `environment_variables` from 0.setting files
109109
export_env_vars() {
110110
config_file_name=$1
111-
if ( python -mplatform || /usr/libexec/platform-python -mplatform ) | grep "redhat-8" > /dev/null; then
112-
commands="`/usr/libexec/platform-python $path_to_parse_env_variables \"$config_file_name\"`"
111+
if ( command -v python3) &> /dev/null;then
112+
commands="`python3 $path_to_parse_env_variables \"$config_file_name\"`"
113113
else
114114
commands="`python $path_to_parse_env_variables \"$config_file_name\"`"
115115
fi

0 commit comments

Comments
 (0)