You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2015/08/04 18:57:48 UTC

[1/2] ambari git commit: AMBARI-12563. Ambari alert return connection refuse because of motd (aonishuk)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 43b4a049a -> eb8e92551
  refs/heads/trunk a06a32438 -> 000848949


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/00084894
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/00084894
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/00084894

Branch: refs/heads/trunk
Commit: 000848949cd0b7d96bfd2ff56d56bc484c24c937
Parents: a06a324
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue Aug 4 19:57:41 2015 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue Aug 4 19:57:41 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/00084894/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))


[2/2] ambari git commit: AMBARI-12563. Ambari alert return connection refuse because of motd (aonishuk)

Posted by ao...@apache.org.
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 <ao...@hortonworks.com>
Authored: Tue Aug 4 19:57:43 2015 +0300
Committer: Andrew Onishuk <ao...@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))