Updated Branches:
  refs/heads/trunk 230a06e99 -> f4b62b546

AMBARI-3460. HDFS Check failed after security enabled. (swagle)


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

Branch: refs/heads/trunk
Commit: f4b62b546a1a9bfb19a84c51fdc419764ee188f7
Parents: 230a06e
Author: Siddharth Wagle <[email protected]>
Authored: Fri Oct 4 11:40:24 2013 -0700
Committer: Siddharth Wagle <[email protected]>
Committed: Fri Oct 4 11:41:01 2013 -0700

----------------------------------------------------------------------
 .../src/main/puppet/modules/hdp-hadoop/files/checkWebUI.py  | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/f4b62b54/ambari-agent/src/main/puppet/modules/hdp-hadoop/files/checkWebUI.py
----------------------------------------------------------------------
diff --git 
a/ambari-agent/src/main/puppet/modules/hdp-hadoop/files/checkWebUI.py 
b/ambari-agent/src/main/puppet/modules/hdp-hadoop/files/checkWebUI.py
index defa05e..faa11e3 100644
--- a/ambari-agent/src/main/puppet/modules/hdp-hadoop/files/checkWebUI.py
+++ b/ambari-agent/src/main/puppet/modules/hdp-hadoop/files/checkWebUI.py
@@ -19,7 +19,7 @@ limitations under the License.
 '''
 
 import optparse
-import urllib
+import httplib
 
 #
 # Main.
@@ -36,8 +36,11 @@ def main():
 
   for host in hosts:
     try:
-      url = 'http://' + host + ':' + port
-      httpCode = urllib.urlopen(url).getcode()
+      conn = httplib.HTTPConnection(host, port)
+      # This can be modified to get a partial url part to be sent with request
+      response = conn.request("GET", "/")
+      httpCode = conn.getresponse().status
+      conn.close()
     except Exception:
       httpCode = 404
 

Reply via email to