Prechádzať zdrojové kódy

AMBARI-10124. Wrong alert on added host on secure cluster (rlevas)

Robert Levas 10 rokov pred
rodič
commit
32e1215639

+ 3 - 3
ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py

@@ -140,8 +140,8 @@ class WebAlert(BaseAlert):
     """
     """
     Makes an http(s) request to a web resource and returns the http code. If
     Makes an http(s) request to a web resource and returns the http code. If
     there was an error making the request, return 0 for the status code.
     there was an error making the request, return 0 for the status code.
-    """    
-
+    """
+    error_msg = None
     try:
     try:
       response_code = 0
       response_code = 0
       kerberos_keytab = None
       kerberos_keytab = None
@@ -210,7 +210,7 @@ class WebAlert(BaseAlert):
 
 
         # empty quotes evaluates to false
         # empty quotes evaluates to false
         if curl_stderr:
         if curl_stderr:
-          raise Exception(curl_stderr)
+          error_msg = curl_stderr
 
 
         # empty quotes evaluates to false
         # empty quotes evaluates to false
         if curl_stdout:
         if curl_stdout: