ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smoha...@apache.org
Subject ambari git commit: AMBARI-12427. Incorrect listeners property in file /etc/kafka/conf/server.properties
Date Wed, 15 Jul 2015 20:25:14 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 515bcf164 -> 73ef2ec03


AMBARI-12427. Incorrect listeners property in file /etc/kafka/conf/server.properties


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

Branch: refs/heads/trunk
Commit: 73ef2ec032b69811234816415f5a8a501745932f
Parents: 515bcf1
Author: Sumit Mohanty <smohanty@hortonworks.com>
Authored: Wed Jul 15 13:22:07 2015 -0700
Committer: Sumit Mohanty <smohanty@hortonworks.com>
Committed: Wed Jul 15 13:22:12 2015 -0700

----------------------------------------------------------------------
 ambari-server/src/main/python/upgradeHelper.py  | 15 ++++---------
 .../src/test/python/TestUpgradeHelper.py        | 22 --------------------
 2 files changed, 4 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/73ef2ec0/ambari-server/src/main/python/upgradeHelper.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/upgradeHelper.py b/ambari-server/src/main/python/upgradeHelper.py
index 8811a0c..bd6d632 100644
--- a/ambari-server/src/main/python/upgradeHelper.py
+++ b/ambari-server/src/main/python/upgradeHelper.py
@@ -1111,24 +1111,17 @@ def get_tez_history_url_base():
   return url
 
 def get_kafka_listeners():
-  kafka_host="localhost"
-  kafka_port="6667"
+  kafka_host = "localhost"
+  kafka_port = "6667"
   if Options.server_config_factory is not None and Options.KAFKA_BROKER_CONF in Options.server_config_factory.items():
     props = Options.server_config_factory.get_config(Options.KAFKA_BROKER_CONF)
     if Options.KAFKA_PORT in props.properties:
       kafka_port = props.properties[Options.KAFKA_PORT]
 
   # Default kafka listeners string
-  kafka_listeners = ["PLAINTEXT://{0}:{1}".format(kafka_host, kafka_port)]
+  kafka_listeners = "PLAINTEXT://{0}:{1}".format(kafka_host, kafka_port)
 
-  # Get hosts where kafka_broker is installed
-  kafka_cfg = curl(Options.COMPONENTS_FORMAT.format(Options.KAFKA_BROKER), validate=False,
simulate=False, parse=True)
-  if "host_components" in kafka_cfg:
-    kafka_listeners = []
-    for item in kafka_cfg["host_components"]:
-      kafka_listeners.append("PLAINTEXT://{0}:{1}".format(item["HostRoles"]["host_name"],
kafka_port))
-
-  return ",".join(kafka_listeners)
+  return kafka_listeners
 
 def get_ranger_xaaudit_hdfs_destination_directory():
   namenode_hostname="localhost"

http://git-wip-us.apache.org/repos/asf/ambari/blob/73ef2ec0/ambari-server/src/test/python/TestUpgradeHelper.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestUpgradeHelper.py b/ambari-server/src/test/python/TestUpgradeHelper.py
index 879c8d2..5aca13d 100644
--- a/ambari-server/src/test/python/TestUpgradeHelper.py
+++ b/ambari-server/src/test/python/TestUpgradeHelper.py
@@ -702,28 +702,6 @@ class TestUpgradeHelper(TestCase):
     self.assertEqual(expected_result, actual_result)
 
   @patch.object(upgradeHelper, "curl")
-  def test_get_kafka_listeners(self, curl_mock):
-    return_curl_data = {
-      "host_components": [
-        {
-          "HostRoles": {
-            "host_name": "test.host.vm"
-          }
-        }
-      ]
-    }
-
-    curl_mock.return_value = copy.deepcopy(return_curl_data)
-
-    # build zookeeper quorum string from return_curl_data and remove trailing comas
-    expected_result = "PLAINTEXT://test.host.vm:6667"
-
-    # execute testing function
-    actual_result = upgradeHelper.get_kafka_listeners()
-
-    self.assertEqual(expected_result, actual_result)
-
-  @patch.object(upgradeHelper, "curl")
   def test_get_ranger_xaaudit_hdfs_destination_directory(self, curl_mock):
     return_curl_data = {
       "host_components": [


Mime
View raw message