You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by od...@apache.org on 2013/12/26 15:41:29 UTC

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

Updated Branches:
  refs/heads/trunk 91ec1eaba -> 35196a776


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


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/35196a77
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/35196a77
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/35196a77

Branch: refs/heads/trunk
Commit: 35196a776aeaf1712773988b07dd81eec537a838
Parents: 91ec1ea
Author: Oleksandr Diachenko <od...@hortonworks.com>
Authored: Thu Dec 26 16:41:17 2013 +0200
Committer: Oleksandr Diachenko <od...@hortonworks.com>
Committed: Thu Dec 26 16:41:17 2013 +0200

----------------------------------------------------------------------
 ambari-server/src/main/python/os_type_check.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/35196a77/ambari-server/src/main/python/os_type_check.sh
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/os_type_check.sh b/ambari-server/src/main/python/os_type_check.sh
index 167dfb3..83e64d1 100644
--- a/ambari-server/src/main/python/os_type_check.sh
+++ b/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" ]