Updated Branches: refs/heads/branch-1.4.1 9d866c3c4 -> b56dc411c
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/b56dc411 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/b56dc411 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/b56dc411 Branch: refs/heads/branch-1.4.1 Commit: b56dc411c19f6655f5c2c6e4a437a37d08851f64 Parents: 9d866c3 Author: Siddharth Wagle <[email protected]> Authored: Fri Oct 4 11:41:25 2013 -0700 Committer: Siddharth Wagle <[email protected]> Committed: Fri Oct 4 11:41:25 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/b56dc411/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
