Skip to content

Commit cff7e39

Browse files
author
Girish Shilamkar
committed
Fixed few hunks which were incorrect.
While adding certain marvin related fixes from master to 4.2 branch incorrect hunks were added. Fixed them.
1 parent 8f53bb2 commit cff7e39

1 file changed

Lines changed: 7 additions & 20 deletions

File tree

‎tools/marvin/marvin/cloudstackConnection.py‎

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333

3434
class cloudConnection(object):
35+
3536
""" Connections to make API calls to the cloudstack management server
3637
"""
3738
def __init__(self, mgmtDet, asyncTimeout=3600, logging=None,
@@ -56,7 +57,7 @@ def __init__(self, mgmtDet, asyncTimeout=3600, logging=None,
5657
(self.apiKey is None and self.securityKey is None):
5758
self.auth = False
5859
if mgmtDet.useHttps == "True":
59-
self.protocol = "https"
60+
self.protocol = "https"
6061
self.baseurl = "%s://%s:%d/%s"\
6162
% (self.protocol, self.mgtSvr, self.port, self.path)
6263

@@ -157,33 +158,19 @@ def request(self, command, auth=True, payload={}, method='GET'):
157158

158159
#Verify whether protocol is "http", then call the request over http
159160
if self.protocol == "http":
160-
if method == 'POST':
161-
response = requests.post(self.baseurl, params=payload,
161+
if method == 'POST':
162+
response = requests.post(self.baseurl, params=payload,
163+
verify=https_flag)
164+
else:
165+
response = requests.get(self.baseurl, params=payload,
162166
verify=https_flag)
163-
else:
164-
response = requests.get(self.baseurl, params=payload,
165-
verify=https_flag)
166167
else:
167168
'''
168169
If protocol is https, then create the connection url with \
169170
user provided certificates \
170171
provided as part of cert
171172
'''
172173
try:
173-
if method == 'POST':
174-
response = requests.post(self.baseurl, params=payload,
175-
cert=cert_path, verify=https_flag)
176-
else:
177-
response = requests.get(self.baseurl, params=payload,
178-
cert=cert_path, verify=https_flag)
179-
except Exception,e:
180-
'''
181-
If an exception occurs with current CA certs,\
182-
then try with default certs path, we dont need \
183-
to mention here the cert path
184-
'''
185-
self.logging.debug( "Creating CS connection over https \
186-
didnt worked with user provided certs %s"%e )
187174
if method == 'POST':
188175
response = requests.post(self.baseurl,
189176
params=payload,

0 commit comments

Comments
 (0)