You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2015/06/24 00:03:36 UTC

ambari git commit: AMBARI-12110. Alerts in Kerberos Environment hold NameNode port (ncole)

Repository: ambari
Updated Branches:
  refs/heads/trunk cc1032ecb -> af12bc565


AMBARI-12110. Alerts in Kerberos Environment hold NameNode port (ncole)


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

Branch: refs/heads/trunk
Commit: af12bc565bf8c77d028512162f4a67e9a96bd949
Parents: cc1032e
Author: Nate Cole <nc...@hortonworks.com>
Authored: Tue Jun 23 17:00:33 2015 -0400
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Tue Jun 23 18:03:29 2015 -0400

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/af12bc56/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 e21b406..b7adac4 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
@@ -42,6 +42,7 @@ except ImportError:
   _md5 = md5.new
 
 CONNECTION_TIMEOUT = 10
+MAX_TIMEOUT = 12
 
 logger = logging.getLogger()
 
@@ -90,12 +91,12 @@ def curl_krb_request(tmp_dir, keytab, principal, url, cache_file_prefix, krb_exe
   try:
     if return_only_http_code:
       _, curl_stdout, curl_stderr = shell.checked_call(['curl', '-k', '--negotiate', '-u', ':', '-b', cookie_file, '-c', cookie_file, '-w',
-                             '%{http_code}', url, '--connect-timeout', str(CONNECTION_TIMEOUT),'-o', '/dev/null'],
+                             '%{http_code}', url, '--connect-timeout', str(CONNECTION_TIMEOUT), '--max-time', str(MAX_TIMEOUT), '-o', '/dev/null'],
                              stderr=subprocess.PIPE, env=kerberos_env, user=user)
     else:
       # returns response body
       _, curl_stdout, curl_stderr = shell.checked_call(['curl', '-k', '--negotiate', '-u', ':', '-b', cookie_file, '-c', cookie_file,
-                             url, '--connect-timeout', str(CONNECTION_TIMEOUT)],
+                             url, '--connect-timeout', str(CONNECTION_TIMEOUT), '--max-time', str(MAX_TIMEOUT)],
                              stderr=subprocess.PIPE, env=kerberos_env, user=user)
   except Fail:
     if logger.isEnabledFor(logging.DEBUG):
@@ -120,4 +121,4 @@ def curl_krb_request(tmp_dir, keytab, principal, url, cache_file_prefix, krb_exe
 
   logger.debug("[Alert][{0}] Curl response is empty! Please take a look at error message: ".
                format(alert_name, str(error_msg)))
-  return ("", error_msg, time_millis)
\ No newline at end of file
+  return ("", error_msg, time_millis)