cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [1/5] git commit: requester: catch exceptions when doing authenticated login
Date Tue, 19 Aug 2014 12:36:55 GMT
Repository: cloudstack-cloudmonkey
Updated Branches:
  refs/heads/master 1b226b0e9 -> 275d2d1da


requester: catch exceptions when doing authenticated login

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/commit/633e2fb9
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/tree/633e2fb9
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/diff/633e2fb9

Branch: refs/heads/master
Commit: 633e2fb95cd2bc443c98b89ad89514d02b19ce35
Parents: 1b226b0
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Tue Aug 19 14:19:09 2014 +0200
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Tue Aug 19 14:19:09 2014 +0200

----------------------------------------------------------------------
 cloudmonkey/requester.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/blob/633e2fb9/cloudmonkey/requester.py
----------------------------------------------------------------------
diff --git a/cloudmonkey/requester.py b/cloudmonkey/requester.py
index 9abbb4d..073190c 100644
--- a/cloudmonkey/requester.py
+++ b/cloudmonkey/requester.py
@@ -159,8 +159,11 @@ def make_request(command, args, logger, url,
     # followed by trying to check if we're using integration port
     # finally use the username/password method
     if not credentials['apikey'] and not ("8096" in url):
-        return make_request_with_password(command, args,
-                                          logger, url, credentials)
+        try:
+            return make_request_with_password(command, args,
+                                              logger, url, credentials)
+        except (requests.exceptions.ConnectionError, Exception), e:
+            return None, e
 
     args['apiKey'] = credentials['apikey']
     secretkey = credentials['secretkey']


Mime
View raw message