ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject git commit: AMBARI-6138. OS key issue on RHEL workstation (in forums) (aonishuk)
Date Wed, 18 Jun 2014 10:16:19 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk c2588d278 -> 2fcd5b11f


AMBARI-6138. OS key issue on RHEL workstation (in forums) (aonishuk)


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

Branch: refs/heads/trunk
Commit: 2fcd5b11f576aca3ce462a4454e8aba3c1b8f847
Parents: c2588d2
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Wed Jun 18 13:16:10 2014 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Wed Jun 18 13:16:10 2014 +0300

----------------------------------------------------------------------
 .../src/main/python/common_functions/os_check.py   |  2 +-
 ambari-server/src/test/python/TestOSCheck.py       | 17 +++++++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2fcd5b11/ambari-common/src/main/python/common_functions/os_check.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/common_functions/os_check.py b/ambari-common/src/main/python/common_functions/os_check.py
index ebdaf06..f652d06 100644
--- a/ambari-common/src/main/python/common_functions/os_check.py
+++ b/ambari-common/src/main/python/common_functions/os_check.py
@@ -104,7 +104,7 @@ class OSCheck:
       return 'oraclelinux'
     elif operatingSystem.startswith('suse linux enterprise server'):
       return 'sles'
-    elif operatingSystem.startswith('red hat enterprise linux server'):
+    elif operatingSystem.startswith('red hat enterprise linux'):
       return 'redhat'
 
     if operatingSystem != '':

http://git-wip-us.apache.org/repos/asf/ambari/blob/2fcd5b11/ambari-server/src/test/python/TestOSCheck.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestOSCheck.py b/ambari-server/src/test/python/TestOSCheck.py
index 7a29ec3..0514c77 100644
--- a/ambari-server/src/test/python/TestOSCheck.py
+++ b/ambari-server/src/test/python/TestOSCheck.py
@@ -68,6 +68,23 @@ class TestOSCheck(TestCase):
     result = OSCheck.get_os_type()
     self.assertEquals(result, 'centos')
 
+    # 5 - Red Hat Enterprise Linux
+    mock_exists.return_value = False
+    # Red Hat Enterprise Linux Server release 6.5 (Santiago)
+    mock_linux_distribution.return_value = ('Red Hat Enterprise Linux Server', '6.5', 'Santiago')
+    result = OSCheck.get_os_type()
+    self.assertEquals(result, 'redhat')
+
+    # Red Hat Enterprise Linux Workstation release 6.4 (Santiago)
+    mock_linux_distribution.return_value = ('Red Hat Enterprise Linux Workstation', '6.4',
'Santiago')
+    result = OSCheck.get_os_type()
+    self.assertEquals(result, 'redhat')
+
+    # Red Hat Enterprise Linux AS release 4 (Nahant Update 3)
+    mock_linux_distribution.return_value = ('Red Hat Enterprise Linux AS', '4', 'Nahant Update
3')
+    result = OSCheck.get_os_type()
+    self.assertEquals(result, 'redhat')
+
 
   @patch("platform.linux_distribution")
   @patch("os.path.exists")


Mime
View raw message