ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vbrodets...@apache.org
Subject ambari git commit: AMBARI-20917. Install: Recommend chronyd instead of ntpd for RHEL 7.(vbrodetskyi)
Date Wed, 03 May 2017 21:23:08 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 154f678d8 -> da9185ce3


AMBARI-20917. Install: Recommend chronyd instead of ntpd for RHEL 7.(vbrodetskyi)


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

Branch: refs/heads/trunk
Commit: da9185ce3c32b95e2d38e67d65e54172d556157a
Parents: 154f678
Author: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Authored: Thu May 4 00:22:34 2017 +0300
Committer: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Committed: Thu May 4 00:22:34 2017 +0300

----------------------------------------------------------------------
 .../src/main/python/ambari_agent/HostInfo.py         | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/da9185ce/ambari-agent/src/main/python/ambari_agent/HostInfo.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/HostInfo.py b/ambari-agent/src/main/python/ambari_agent/HostInfo.py
index 4b7bfd7..5f96df5 100644
--- a/ambari-agent/src/main/python/ambari_agent/HostInfo.py
+++ b/ambari-agent/src/main/python/ambari_agent/HostInfo.py
@@ -68,9 +68,22 @@ class HostInfo(object):
     return 'unknown'
 
   def checkLiveServices(self, services, result):
+    is_redhat7_or_higher = False
+    is_redhat = False
+
+    if OSCheck.is_redhat_family():
+      is_redhat = True
+      if int(OSCheck.get_os_major_version()) >= 7:
+        is_redhat7_or_higher = True
+
     for service in services:
       svcCheckResult = {}
-      svcCheckResult['name'] = " or ".join(service)
+      if "ntpd" in service and is_redhat7_or_higher:
+        svcCheckResult['name'] = "chronyd"
+      elif "chronyd" in service and is_redhat:
+        svcCheckResult['name'] = "ntpd"
+      else:
+        svcCheckResult['name'] = " or ".join(service)
       svcCheckResult['status'] = "UNKNOWN"
       svcCheckResult['desc'] = ""
       try:


Mime
View raw message