ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [2/2] ambari git commit: AMBARI-12563. Ambari alert return connection refuse because of motd (aonishuk)
Date Tue, 04 Aug 2015 16:57:49 GMT
AMBARI-12563.  Ambari alert return connection refuse because of motd (aonishuk)


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

Branch: refs/heads/branch-2.1
Commit: eb8e925516231e912d88abf1bc642c35381a5e88
Parents: 43b4a04
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Tue Aug 4 19:57:43 2015 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Tue Aug 4 19:57:43 2015 +0300

----------------------------------------------------------------------
 .../libraries/functions/curl_krb_request.py                 | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/eb8e9255/ambari-common/src/main/python/resource_management/libraries/functions/curl_krb_request.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/curl_krb_request.py
b/ambari-common/src/main/python/resource_management/libraries/functions/curl_krb_request.py
index 589ec1e..f5996fa 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/curl_krb_request.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/curl_krb_request.py
@@ -30,6 +30,7 @@ from resource_management.core import shell
 from resource_management.core.exceptions import Fail
 from get_kinit_path import get_kinit_path
 from get_klist_path import get_klist_path
+from resource_management.libraries.functions.get_user_call_output import get_user_call_output
 # hashlib is supplied as of Python 2.5 as the replacement interface for md5
 # and other secure hashes.  In 2.6, md5 is deprecated.  Import hashlib if
 # available, avoiding a deprecation warning under 2.6.  Import md5 otherwise,
@@ -98,14 +99,14 @@ def curl_krb_request(tmp_dir, keytab, principal, url, cache_file_prefix,
 
   try:
     if return_only_http_code:
-      _, curl_stdout, curl_stderr = shell.checked_call(['curl', '-k', '--negotiate', '-u',
':', '-b', cookie_file, '-c', cookie_file, '-w',
+      _, curl_stdout, curl_stderr = get_user_call_output(['curl', '-k', '--negotiate', '-u',
':', '-b', cookie_file, '-c', cookie_file, '-w',
                              '%{http_code}', url, '--connect-timeout', str(connection_timeout),
'--max-time', str(maximum_timeout), '-o', '/dev/null'],
-                             stderr=subprocess.PIPE, env=kerberos_env, user=user)
+                             user=user, env=kerberos_env)
     else:
       # returns response body
-      _, curl_stdout, curl_stderr = shell.checked_call(['curl', '-k', '--negotiate', '-u',
':', '-b', cookie_file, '-c', cookie_file,
+      _, curl_stdout, curl_stderr = get_user_call_output(['curl', '-k', '--negotiate', '-u',
':', '-b', cookie_file, '-c', cookie_file,
                              url, '--connect-timeout', str(connection_timeout), '--max-time',
str(maximum_timeout)],
-                             stderr=subprocess.PIPE, env=kerberos_env, user=user)
+                             user=user, env=kerberos_env)
   except Fail:
     if logger.isEnabledFor(logging.DEBUG):
       logger.exception("[Alert][{0}] Unable to make a web request.".format(alert_name))


Mime
View raw message