cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject cloudstack-cloudmonkey git commit: requester: pass verifysslcert option while user logs in
Date Wed, 03 Dec 2014 17:43:30 GMT
Repository: cloudstack-cloudmonkey
Updated Branches:
  refs/heads/5.3 85343084e -> 91afdd318


requester: pass verifysslcert option while user logs in

Thanks to Yuri Kogun <ykogun@outlook.com> for reporting this issue on the
user ML.

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/91afdd31
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/tree/91afdd31
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/diff/91afdd31

Branch: refs/heads/5.3
Commit: 91afdd318f4ecba13963742f4c0bf28748093ff9
Parents: 8534308
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Wed Dec 3 23:09:49 2014 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Wed Dec 3 23:10:32 2014 +0530

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


http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/blob/91afdd31/cloudmonkey/requester.py
----------------------------------------------------------------------
diff --git a/cloudmonkey/requester.py b/cloudmonkey/requester.py
index 13dce20..6be896a 100644
--- a/cloudmonkey/requester.py
+++ b/cloudmonkey/requester.py
@@ -52,7 +52,7 @@ def writeError(msg):
     sys.stderr.flush()
 
 
-def login(url, username, password, domain="/"):
+def login(url, username, password, domain="/", verifysslcert=False):
     """
     Login and obtain a session to be used for subsequent API calls
     Wrong username/password leads to HTTP error code 531
@@ -69,7 +69,7 @@ def login(url, username, password, domain="/"):
     session = requests.Session()
 
     try:
-        resp = session.post(url, params=args)
+        resp = session.post(url, params=args, verify=verifysslcert)
     except requests.exceptions.ConnectionError, e:
         writeError("Connection refused by server: %s" % e)
         return None, None
@@ -121,7 +121,8 @@ def make_request_with_password(command, args, logger, url, credentials,
 
         # obtain a valid session if not supplied
         if not (session and sessionkey):
-            session, sessionkey = login(url, username, password, domain)
+            session, sessionkey = login(url, username, password, domain,
+                                        verifysslcert)
             if not (session and sessionkey):
                 return None, 'Authentication failed'
             credentials['session'] = session


Mime
View raw message