You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2015/12/06 16:12:09 UTC

[1/2] ambari git commit: AMBARI-14236. HDFS and Yarn alerts in https mode when kerberos is disabled (aonishuk)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 e50b5b874 -> cf03a2ba7
  refs/heads/trunk ec2ba540e -> 85a14993d


AMBARI-14236. HDFS and Yarn alerts in https mode when kerberos is disabled (aonishuk)


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

Branch: refs/heads/trunk
Commit: 85a14993d6eb848b69b6717512f792f62ff5978f
Parents: ec2ba54
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Sun Dec 6 17:11:57 2015 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Sun Dec 6 17:11:57 2015 +0200

----------------------------------------------------------------------
 .../src/main/python/ambari_agent/alerts/web_alert.py    | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/85a14993/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py b/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py
index 0d627c3..502526c 100644
--- a/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py
+++ b/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py
@@ -22,6 +22,8 @@ import logging
 import time
 import os
 import urllib2
+import ssl
+from functools import wraps
 from urllib2 import HTTPError
 
 from  tempfile import gettempdir
@@ -51,6 +53,16 @@ DEFAULT_CONNECTION_TIMEOUT = 5
 
 WebResponse = namedtuple('WebResponse', 'status_code time_millis error_msg')
 
+# patch ssl module to fix SSLv3 communication bug
+# for more info see http://stackoverflow.com/questions/9835506/urllib-urlopen-works-on-sslv3-urls-with-python-2-6-6-on-1-machine-but-not-wit
+def sslwrap(func):
+    @wraps(func)
+    def bar(*args, **kw):
+        kw['ssl_version'] = ssl.PROTOCOL_TLSv1
+        return func(*args, **kw)
+    return bar
+ssl.wrap_socket = sslwrap(ssl.wrap_socket)
+
 class WebAlert(BaseAlert):
 
   def __init__(self, alert_meta, alert_source_meta, config):


[2/2] ambari git commit: AMBARI-14236. HDFS and Yarn alerts in https mode when kerberos is disabled (aonishuk)

Posted by ao...@apache.org.
AMBARI-14236. HDFS and Yarn alerts in https mode when kerberos is disabled (aonishuk)


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

Branch: refs/heads/branch-2.2
Commit: cf03a2ba7aca18bbb440f17570a3f9853b08df6c
Parents: e50b5b8
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Sun Dec 6 17:11:59 2015 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Sun Dec 6 17:11:59 2015 +0200

----------------------------------------------------------------------
 .../src/main/python/ambari_agent/alerts/web_alert.py    | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/cf03a2ba/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py b/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py
index 0d627c3..502526c 100644
--- a/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py
+++ b/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py
@@ -22,6 +22,8 @@ import logging
 import time
 import os
 import urllib2
+import ssl
+from functools import wraps
 from urllib2 import HTTPError
 
 from  tempfile import gettempdir
@@ -51,6 +53,16 @@ DEFAULT_CONNECTION_TIMEOUT = 5
 
 WebResponse = namedtuple('WebResponse', 'status_code time_millis error_msg')
 
+# patch ssl module to fix SSLv3 communication bug
+# for more info see http://stackoverflow.com/questions/9835506/urllib-urlopen-works-on-sslv3-urls-with-python-2-6-6-on-1-machine-but-not-wit
+def sslwrap(func):
+    @wraps(func)
+    def bar(*args, **kw):
+        kw['ssl_version'] = ssl.PROTOCOL_TLSv1
+        return func(*args, **kw)
+    return bar
+ssl.wrap_socket = sslwrap(ssl.wrap_socket)
+
 class WebAlert(BaseAlert):
 
   def __init__(self, alert_meta, alert_source_meta, config):