ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gau...@apache.org
Subject ambari git commit: AMBARI-14710. Add retry logic for REST calls between Ambari and Ranger(gautam)
Date Tue, 19 Jan 2016 04:27:37 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 872a9ad5a -> e39db418f


AMBARI-14710. Add retry logic for REST calls between Ambari and Ranger(gautam)


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

Branch: refs/heads/branch-2.2
Commit: e39db418fbcab58205c78d416dfb670fcd83e80d
Parents: 872a9ad
Author: Gautam Borad <gautam@apache.org>
Authored: Mon Jan 18 22:24:43 2016 +0530
Committer: Gautam Borad <gautam@apache.org>
Committed: Tue Jan 19 09:57:14 2016 +0530

----------------------------------------------------------------------
 .../libraries/functions/ranger_functions.py                  | 8 +++-----
 .../libraries/functions/ranger_functions_v2.py               | 8 +++-----
 2 files changed, 6 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e39db418/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 543a31f..c59dc8d 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
@@ -219,13 +219,11 @@ class Rangeradmin:
       return response_code
     except urllib2.URLError, e:
       if isinstance(e, urllib2.HTTPError):
-        Logger.error("Connection to Ranger Admin failed. Http status code - {0}. \n {1}".format(e.code,
e.read()))
+        raise Fail("Connection to Ranger Admin failed. Http status code - {0}. \n {1}".format(e.code,
e.read()))
       else:
-        Logger.error("Connection to Ranger Admin failed. Reason - {0}.".format(e.reason))
-      return None
+        raise Fail("Connection to Ranger Admin failed. Reason - {0}.".format(e.reason))
     except httplib.BadStatusLine, e:
-      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")
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e39db418/ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions_v2.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions_v2.py
b/ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions_v2.py
index 80965a6..a72be33 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions_v2.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions_v2.py
@@ -183,13 +183,11 @@ class RangeradminV2:
       return response_code
     except urllib2.URLError, e:
       if isinstance(e, urllib2.HTTPError):
-        Logger.error("Connection failed to Ranger Admin. Http status code - {0}. \n {1}".format(e.code,
e.read()))
+        raise Fail("Connection failed to Ranger Admin. Http status code - {0}. \n {1}".format(e.code,
e.read()))
       else:
-        Logger.error("Connection failed to Ranger Admin. Reason - {0}.".format(e.reason))
-      return None
+        raise Fail("Connection failed to Ranger Admin. Reason - {0}.".format(e.reason))
     except httplib.BadStatusLine, e:
-      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 failed to Ranger Admin. Reason - timeout")
 


Mime
View raw message