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 2016/04/25 21:04:30 UTC

[1/3] ambari git commit: AMBARI-16104. HBase service check fails on an HA cluster deployed via blueprint (aonishuk)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 1cc15c148 -> e016942d2
  refs/heads/branch-2.2.2 480feeee6 -> 2c1702429
  refs/heads/trunk e1e51217e -> fb90e9b20


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


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

Branch: refs/heads/trunk
Commit: fb90e9b2081dce6b87ef03ad8c0cb7c642b7cfbb
Parents: e1e5121
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Mon Apr 25 22:04:20 2016 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Mon Apr 25 22:04:20 2016 +0300

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


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


[2/3] ambari git commit: AMBARI-16104. HBase service check fails on an HA cluster deployed via blueprint (aonishuk)

Posted by ao...@apache.org.
AMBARI-16104. HBase service check fails on an HA cluster deployed via blueprint (aonishuk)


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

Branch: refs/heads/branch-2.2
Commit: e016942d2cb9450591e7f49bc146d4a7157a321c
Parents: 1cc15c1
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Mon Apr 25 22:04:23 2016 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Mon Apr 25 22:04:23 2016 +0300

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


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


[3/3] ambari git commit: AMBARI-16104. HBase service check fails on an HA cluster deployed via blueprint (aonishuk)

Posted by ao...@apache.org.
AMBARI-16104. HBase service check fails on an HA cluster deployed via blueprint (aonishuk)


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

Branch: refs/heads/branch-2.2.2
Commit: 2c17024298a356856db9b5d5a4a24a5320df9aa7
Parents: 480feee
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Mon Apr 25 22:04:26 2016 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Mon Apr 25 22:04:26 2016 +0300

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


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