You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sm...@apache.org on 2015/03/26 01:38:05 UTC

ambari git commit: Ambari-7767. Add an agent config to discover server hostname via a script

Repository: ambari
Updated Branches:
  refs/heads/trunk 308a618f4 -> f3359f526


Ambari-7767. Add an agent config to discover server hostname via a script


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

Branch: refs/heads/trunk
Commit: f3359f526edd55f1d6319fe147d156e7ff5cf56b
Parents: 308a618
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Wed Mar 25 17:37:18 2015 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Wed Mar 25 17:37:37 2015 -0700

----------------------------------------------------------------------
 ambari-agent/src/main/python/ambari_agent/hostname.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f3359f52/ambari-agent/src/main/python/ambari_agent/hostname.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/hostname.py b/ambari-agent/src/main/python/ambari_agent/hostname.py
index e6140da..e33b739 100644
--- a/ambari-agent/src/main/python/ambari_agent/hostname.py
+++ b/ambari-agent/src/main/python/ambari_agent/hostname.py
@@ -67,7 +67,7 @@ def public_hostname(config):
       out, err = output.communicate()
       if (0 == output.returncode and 0 != len(out.strip())):
         cached_public_hostname = out.strip()
-        logger.info("Read public hostname " + cached_public_hostname + "using agent:public_hostname_script")
+        logger.info("Read public hostname '" + cached_public_hostname + "' using agent:public_hostname_script")
         return cached_public_hostname
   except:
     #ignore for now.
@@ -87,6 +87,9 @@ def public_hostname(config):
   return cached_public_hostname
 
 def server_hostname(config):
+  """
+  Reads the ambari server name from the config or using the supplied script
+  """
   global cached_server_hostname
   if cached_server_hostname is not None:
     return cached_server_hostname
@@ -98,7 +101,7 @@ def server_hostname(config):
       out, err = osStat.communicate()
       if (0 == osStat.returncode and 0 != len(out.strip())):
         cached_server_hostname = out.strip()
-        logger.info("Read server hostname " + cached_server_hostname + "using server:hostname_script")
+        logger.info("Read server hostname '" + cached_server_hostname + "' using server:hostname_script")
     except Exception, err:
       logger.info("Unable to execute hostname_script for server hostname. " + str(err))