Browse Source

AMBARI-4101. OS version checking incorrectly reports "centos5" when os is centos 6.5. (Dmytro Shkvyra via odiachenko)

Oleksandr Diachenko 11 years ago
parent
commit
35196a776a
1 changed files with 3 additions and 2 deletions
  1. 3 2
      ambari-server/src/main/python/os_type_check.sh

+ 3 - 2
ambari-server/src/main/python/os_type_check.sh

@@ -32,8 +32,8 @@ pattern='[^[:digit:]]*'
 # OS type detection
 if [ -f  "/etc/centos-release" ] 
 then
-  grep -qE "${pattern}6" /etc/centos-release && current_os=$C6
-  grep -qE "${pattern}5" /etc/centos-release && current_os=$C5
+  grep -sqiE "^centos ${pattern}6" /etc/centos-release && current_os=$C6
+  grep -sqiE "^centos ${pattern}5" /etc/centos-release && current_os=$C5
 elif [ -f  "/etc/oracle-release" ] || [ -f  "/etc/ovs-release" ] || [ -f  "/etc/enterprise-release" ] 
 then
   grep -sqE "${pattern}6" /etc/oracle-release || grep -sqE "${pattern}6" /etc/ovs-release || \
@@ -43,6 +43,7 @@ then
 elif [ -f  "/etc/redhat-release" ]
 then
   grep -sqiE "^centos ${pattern}5" /etc/redhat-release && current_os=$C5
+  grep -sqiE "^centos ${pattern}6" /etc/redhat-release && current_os=$C6
   grep -sqE "^Red Hat Enterprise Linux ${pattern}6" /etc/redhat-release && current_os=$RH6
   grep -sqE "^Red Hat Enterprise Linux ${pattern}5" /etc/redhat-release && current_os=$RH5
 elif [ -f  "/etc/SuSE-release" ]