Updated Branches:
  refs/heads/trunk e059591f7 -> e92df28ec

AMBARI-3153: Secure cluster: Yarn service check fails after configuring yarn 
for spnego authentication. (jaimin)


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

Branch: refs/heads/trunk
Commit: e92df28ecb135e6536da4406509650592eaeb0e4
Parents: e059591
Author: Jaimin Jetly <[email protected]>
Authored: Tue Sep 17 17:45:24 2013 -0700
Committer: Jaimin Jetly <[email protected]>
Committed: Tue Sep 17 17:45:33 2013 -0700

----------------------------------------------------------------------
 .../hdp-yarn/files/validateYarnComponentStatus.py   | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/e92df28e/ambari-agent/src/main/puppet/modules/hdp-yarn/files/validateYarnComponentStatus.py
----------------------------------------------------------------------
diff --git 
a/ambari-agent/src/main/puppet/modules/hdp-yarn/files/validateYarnComponentStatus.py
 
b/ambari-agent/src/main/puppet/modules/hdp-yarn/files/validateYarnComponentStatus.py
index 9eb3444..531113c 100644
--- 
a/ambari-agent/src/main/puppet/modules/hdp-yarn/files/validateYarnComponentStatus.py
+++ 
b/ambari-agent/src/main/puppet/modules/hdp-yarn/files/validateYarnComponentStatus.py
@@ -19,7 +19,7 @@ limitations under the License.
 '''
 
 import optparse
-import urllib2, urllib
+import subprocess
 import json
 
 RESOURCEMANAGER = 'rm'
@@ -32,13 +32,15 @@ RUNNING_STATE = 'RUNNING'
 #Return reponse for given path and address
 def getResponse(path, address):
 
+  command = "curl"
+  httpGssnegotiate = "--negotiate"
+  userpswd = "-u:"
+  url = 'http://' + address + path
+  command_with_flags = [command,httpGssnegotiate,userpswd,url]
   try:
-    url = 'http://' + address + path
-    opener = urllib2.build_opener()
-    urllib2.install_opener(opener)
-    request = urllib2.Request(url)
-    handler = urllib2.urlopen(request)
-    response = json.loads(handler.read())
+    proc = subprocess.Popen(command_with_flags, stdout=subprocess.PIPE, 
stderr=subprocess.PIPE)
+    (stdout, stderr) = proc.communicate()
+    response = json.loads(stdout)
     if response == None:
       print 'There is no response for url: ' + str(url)
       exit(1)

Reply via email to