Updated Branches: refs/heads/0.8 f53fe1836 -> a6904a264
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/0.8 Commit: a6904a2644a95a3d8d2a59e3915a76e7ee43557a Parents: f53fe18 Author: John Fung <[email protected]> Authored: Tue Oct 8 09:22:32 2013 -0700 Committer: Jun Rao <[email protected]> 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"):
