You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ma...@apache.org on 2014/04/03 01:22:03 UTC

git commit: AMBARI-5332. Print better logs for openssl issues on centos/rhel 6.5. (mahadev)

Repository: ambari
Updated Branches:
  refs/heads/trunk ddf5ce89e -> 8b763e174


AMBARI-5332. Print better logs for openssl issues on centos/rhel 6.5. (mahadev)


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

Branch: refs/heads/trunk
Commit: 8b763e174826bc6479973ca3b844aa504d942c8d
Parents: ddf5ce8
Author: Mahadev Konar <ma...@apache.org>
Authored: Wed Apr 2 15:19:54 2014 -0700
Committer: Mahadev Konar <ma...@apache.org>
Committed: Wed Apr 2 16:21:52 2014 -0700

----------------------------------------------------------------------
 ambari-agent/src/main/python/ambari_agent/NetUtil.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8b763e17/ambari-agent/src/main/python/ambari_agent/NetUtil.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/NetUtil.py b/ambari-agent/src/main/python/ambari_agent/NetUtil.py
index bf18ad8..ece7b8f 100644
--- a/ambari-agent/src/main/python/ambari_agent/NetUtil.py
+++ b/ambari-agent/src/main/python/ambari_agent/NetUtil.py
@@ -18,6 +18,7 @@ from urlparse import urlparse
 import time
 import logging
 import httplib
+from ssl import SSLError
 
 logger = logging.getLogger()
 
@@ -51,8 +52,14 @@ class NetUtil:
         return True
       else: 
         return False
+    except SSLError as slerror:
+      logger.error(str(slerror))
+      logger.error("SSLError: Failed to connect. Please check openssl library versions. \n" +
+                   "Refer to: https://bugzilla.redhat.com/show_bug.cgi?id=1022468 for more details.")
+      return False
+    
     except Exception, e:
-      logger.info("Failed to connect to " + str(url) + " due to " + str(e))
+      logger.warning("Failed to connect to " + str(url) + " due to " + str(e) + "  ")
       return False
 
   def try_to_connect(self, server_url, max_retries, logger = None):