AMBARI-18263. Agent connection retry fails after one try (magyari_sandor)

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

Branch: refs/heads/AMBARI-2.4.0.2
Commit: 17b583c493802c64473a5b319ed71ac26c3d8c4d
Parents: 7079adc
Author: Sandor Magyari <[email protected]>
Authored: Mon Aug 29 17:35:06 2016 +0200
Committer: Sandor Magyari <[email protected]>
Committed: Fri Sep 2 17:52:40 2016 +0200

----------------------------------------------------------------------
 ambari-agent/src/main/python/ambari_agent/main.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/17b583c4/ambari-agent/src/main/python/ambari_agent/main.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/main.py 
b/ambari-agent/src/main/python/ambari_agent/main.py
index c0f7b81..f7c951c 100644
--- a/ambari-agent/src/main/python/ambari_agent/main.py
+++ b/ambari-agent/src/main/python/ambari_agent/main.py
@@ -343,9 +343,9 @@ def main(heartbeat_stop_callback=None):
   # Keep trying to connect to a server or bail out if ambari-agent was stopped
   while not connected and not stopped:
     for server_hostname in server_hostnames:
+      server_url = config.get_api_url(server_hostname)
       try:
         server_ip = socket.gethostbyname(server_hostname)
-        server_url = config.get_api_url(server_hostname)
         logger.info('Connecting to Ambari server at %s (%s)', server_url, 
server_ip)
       except socket.error:
         logger.warn("Unable to determine the IP address of the Ambari server 
'%s'", server_hostname)

Reply via email to