ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmitriu...@apache.org
Subject [1/2] ambari git commit: AMBARI-13128. RU: Kafka Service Check failed after retry (dlysnichenko)
Date Thu, 17 Sep 2015 17:25:27 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 87e9ded96 -> 9795cc131
  refs/heads/trunk 24dfa2fb0 -> f438b28c2


AMBARI-13128. RU: Kafka Service Check failed after retry (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: f438b28c2c75332b5e2a767acb338478337ce00c
Parents: 24dfa2f
Author: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Authored: Thu Sep 17 20:24:32 2015 +0300
Committer: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Committed: Thu Sep 17 20:24:32 2015 +0300

----------------------------------------------------------------------
 .../KAFKA/0.8.1.2.2/package/scripts/service_check.py | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f438b28c/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/service_check.py
b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/service_check.py
index f76e954..d8acd4a 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/service_check.py
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/service_check.py
@@ -21,6 +21,7 @@ from resource_management.libraries.script.script import Script
 from resource_management.libraries.functions.validate import call_and_match_output
 from resource_management.libraries.functions.format import format
 from resource_management.core.logger import Logger
+from resource_management.core import sudo
 
 class ServiceCheck(Script):
   def service_check(self, env):
@@ -45,13 +46,13 @@ class ServiceCheck(Script):
     import params
     
     kafka_config = {}
-    with open(params.conf_dir+"/server.properties", "r") as conf_file:
-      for line in conf_file:
-        if line.startswith("#") or not line.strip():
-          continue 
-        
-        key,value = line.split("=")
-        kafka_config[key] = value.replace("\n","")
+    content = sudo.read_file(params.conf_dir + "/server.properties")
+    for line in content.splitlines():
+      if line.startswith("#") or not line.strip():
+        continue
+
+      key, value = line.split("=")
+      kafka_config[key] = value.replace("\n", "")
     
     return kafka_config
 


Mime
View raw message