ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject ambari git commit: Revert "AMBARI-16104. HBase service check fails on an HA cluster deployed via blueprint (aonishuk)"
Date Mon, 25 Apr 2016 19:42:33 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk fb90e9b20 -> 020b1c787


Revert "AMBARI-16104. HBase service check fails on an HA cluster deployed via blueprint (aonishuk)"

This reverts commit fb90e9b2081dce6b87ef03ad8c0cb7c642b7cfbb.


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

Branch: refs/heads/trunk
Commit: 020b1c7872c2fe88a19c5ed087de22db38db7ddc
Parents: fb90e9b
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Mon Apr 25 22:42:18 2016 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Mon Apr 25 22:42:18 2016 +0300

----------------------------------------------------------------------
 .../libraries/functions/ranger_functions.py     | 23 ++++++++++++--------
 1 file changed, 14 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/020b1c78/ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions.py
b/ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions.py
index 40f75f7..84a03a3 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions.py
@@ -174,7 +174,8 @@ class Rangeradmin:
           policiesUpdateCount = 0
           for policy in policyList:
             updatedPolicyObj = self.get_policy_params(typeOfPolicy, policy, policy_user)
-            policyResCode = self.update_ranger_policy(updatedPolicyObj['id'], json.dumps(updatedPolicyObj),
usernamepassword)
+            policyResCode, policyResponse = self.update_ranger_policy(updatedPolicyObj['id'],
+                                                                      json.dumps(updatedPolicyObj),
usernamepassword)
             if policyResCode == 200:
               policiesUpdateCount = policiesUpdateCount + 1
             else:
@@ -247,11 +248,13 @@ class Rangeradmin:
         return None
     except urllib2.URLError, e:
       if isinstance(e, urllib2.HTTPError):
-        raise Fail("Error getting policy from repository {0} for component {1}. Http status
code - {2}. \n {3}".format(name, component, e.code, e.read()))
+        Logger.error("Error getting policy from repository {0} for component {1}. Http status
code - {2}. \n {3}".format(name, component, e.code, e.read()))
       else:
-        raise Fail("Error getting policy from repository {0} for component {1}. Reason -
{2}.".format(name, component, e.reason))
+        Logger.error("Error getting policy from repository {0} for component {1}. Reason
- {2}.".format(name, component, e.reason))
+      return None
     except httplib.BadStatusLine:
-      raise Fail("Ranger Admin service is not reachable, please restart the service and then
try again")
+      Logger.error("Ranger Admin service is not reachable, please restart the service and
then try again")
+      return None
     except TimeoutError:
       raise Fail("Connection to Ranger Admin failed. Reason - timeout")
 
@@ -278,17 +281,19 @@ class Rangeradmin:
       response = json.loads(json.JSONEncoder().encode(result.read()))
       if response_code == 200:
         Logger.info('Policy updated Successfully')
-        return response_code
+        return response_code, response
       else:
         Logger.error('Update Policy failed')
-        return None
+        return None, None
     except urllib2.URLError, e:
       if isinstance(e, urllib2.HTTPError):
-        raise Fail("Error updating policy. Http status code - {0}. \n {1}".format(e.code,
e.read()))
+        Logger.error("Error updating policy. Http status code - {0}. \n {1}".format(e.code,
e.read()))
       else:
-        raise Fail("Error updating policy. Reason - {0}.".format(e.reason))
+        Logger.error("Error updating policy. Reason - {0}.".format(e.reason))
+      return None, None
     except httplib.BadStatusLine:
-      raise Fail("Ranger Admin service is not reachable, please restart the service and then
try again")
+      Logger.error("Ranger Admin service is not reachable, please restart the service and
then try again")
+      return None, None
     except TimeoutError:
       raise Fail("Connection to Ranger Admin failed. Reason - timeout")
 


Mime
View raw message