kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jun...@apache.org
Subject [2/4] git commit: kafka-1078; Update System Test to handle controller data returned by ZK; patched by John Fung; reviewed by Jun Rao
Date Tue, 08 Oct 2013 20:13:15 GMT
kafka-1078; Update System Test to handle controller data returned by ZK; patched by John Fung;
reviewed by Jun Rao


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

Branch: refs/heads/trunk
Commit: a6904a2644a95a3d8d2a59e3915a76e7ee43557a
Parents: f53fe18
Author: John Fung <fung.john@gmail.com>
Authored: Tue Oct 8 09:22:32 2013 -0700
Committer: Jun Rao <junrao@gmail.com>
Committed: Tue Oct 8 09:22:32 2013 -0700

----------------------------------------------------------------------
 system_test/utils/kafka_system_test_utils.py | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/a6904a26/system_test/utils/kafka_system_test_utils.py
----------------------------------------------------------------------
diff --git a/system_test/utils/kafka_system_test_utils.py b/system_test/utils/kafka_system_test_utils.py
index 1b473eb..aec31cb 100644
--- a/system_test/utils/kafka_system_test_utils.py
+++ b/system_test/utils/kafka_system_test_utils.py
@@ -1878,10 +1878,16 @@ def get_controller_attributes(systemTestEnv, testcaseEnv):
     logger.debug("executing command [" + cmdStr + "]", extra=d)
     subproc = system_test_utils.sys_call_return_subproc(cmdStr)
     for line in subproc.stdout.readlines():
-        brokerid = line.rstrip('\n')
-        controllerDict["brokerid"]  = brokerid
-        controllerDict["entity_id"] = system_test_utils.get_data_by_lookup_keyval(
-                                          tcConfigsList, "broker.id", brokerid, "entity_id")
+        if "brokerid" in line:
+            json_str  = line.rstrip('\n')
+            json_data = json.loads(json_str)
+            brokerid  = str(json_data["brokerid"])
+            controllerDict["brokerid"]  = brokerid
+            controllerDict["entity_id"] = system_test_utils.get_data_by_lookup_keyval(
+                                              tcConfigsList, "broker.id", brokerid, "entity_id")
+        else:
+            pass
+
     return controllerDict
 
 def getMinCommonStartingOffset(systemTestEnv, testcaseEnv, clusterName="source"):


Mime
View raw message