Repository: ambari
Updated Branches:
  refs/heads/trunk 3985154fe -> c579d2747


Revert "AMBARI-9278. Allow hostname customization for metric monitor. Use agent 
conf. (swagle)"

Metrics Monitor cannot start.
This reverts commit af5372656b9679b10e2792da8dd0ca4510ba1962.


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

Branch: refs/heads/trunk
Commit: c579d2747e01543bb5dd9bf6ed4e16a87fc7c4c7
Parents: 3985154
Author: Yusaku Sako <yus...@hortonworks.com>
Authored: Thu Jan 22 17:52:29 2015 -0800
Committer: Yusaku Sako <yus...@hortonworks.com>
Committed: Thu Jan 22 17:52:42 2015 -0800

----------------------------------------------------------------------
 .../src/main/python/core/config_reader.py           | 16 ++--------------
 .../src/main/python/core/host_info.py               |  1 +
 2 files changed, 3 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c579d274/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py
----------------------------------------------------------------------
diff --git 
a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py
 
b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py
index 62a5f16..f43f512 100644
--- 
a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py
+++ 
b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py
@@ -61,6 +61,7 @@ class ConfigDefaultsLinux(ConfigDefaults):
 
 configDefaults = ConfigDefaults()
 
+
 config = ConfigParser.RawConfigParser()
 
 CONFIG_FILE_PATH = configDefaults.get_config_file_path()
@@ -83,8 +84,6 @@ STOP_ACTION = "stop"
 RESTART_ACTION = "restart"
 STATUS_ACTION = "status"
 
-AMBARI_AGENT_CONF = '/etc/ambari-agent/conf/ambari-agent.ini'
-
 config_content = """
 [default]
 debug_level = INFO
@@ -140,7 +139,6 @@ metric_group_info = """
 }
 """
 
-
 class Configuration:
 
   def __init__(self):
@@ -162,13 +160,6 @@ class Configuration:
       }
     pass
 
-    self.hostname_script = None
-    ambari_agent_config = ConfigParser.RawConfigParser()
-    if os.path.exists(AMBARI_AGENT_CONF):
-      ambari_agent_config.read(AMBARI_AGENT_CONF)
-      self.hostname_script = ambari_agent_config.get('agent', 
'hostname_script')
-    pass
-
   def getConfig(self):
     return self.config
 
@@ -192,10 +183,7 @@ class Configuration:
     return self.get("default", "metrics_server")
 
   def get_hostname_script(self):
-    if self.hostname_script:
-      return self.hostname_script
-    else:
-      return self.get("default", "hostname_script")
+    return self.get("default", "hostname_script")
 
   def get_log_level(self):
     return self.get("default", "debug_level", "INFO")

http://git-wip-us.apache.org/repos/asf/ambari/blob/c579d274/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
----------------------------------------------------------------------
diff --git 
a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
 
b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
index caa972c..37c55cb 100644
--- 
a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
+++ 
b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
@@ -23,6 +23,7 @@ import psutil
 import os
 from collections import namedtuple
 import platform
+import socket
 import time
 import threading
 import socket

Reply via email to