Skip to content

Commit 175ead4

Browse files
Santhosh EdukullaPrasanna Santhanam
authored andcommitted
CLOUDSTACK-5121: There was one wrong initialization of cloudstackConnection.
The bug mentioned is causing test cases to fail. Signed-off-by: Santhosh Edukulla <Santhosh.Edukulla@citrix.com>
1 parent f629d40 commit 175ead4

4 files changed

Lines changed: 15 additions & 21 deletions

File tree

tools/marvin/marvin/cloudstackConnection.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class cloudConnection(object):
3636
""" Connections to make API calls to the cloudstack management server
3737
"""
3838
def __init__(self, mgmtDet, asyncTimeout=3600, logging=None,
39-
scheme='http', path='client/api'):
39+
path='client/api'):
4040
self.loglevel() # Turn off requests logs
4141
self.apiKey = mgmtDet.apiKey
4242
self.securityKey = mgmtDet.securityKey
@@ -49,7 +49,8 @@ def __init__(self, mgmtDet, asyncTimeout=3600, logging=None,
4949
self.logging = logging
5050
self.path = path
5151
self.retries = 5
52-
self.protocol = scheme
52+
self.mgtDetails = mgmtDet
53+
self.protocol = "http"
5354
self.asyncTimeout = asyncTimeout
5455
self.auth = True
5556
if self.port == 8096 or \
@@ -61,11 +62,9 @@ def __init__(self, mgmtDet, asyncTimeout=3600, logging=None,
6162
% (self.protocol, self.mgtSvr, self.port, self.path)
6263

6364
def __copy__(self):
64-
return cloudConnection(self.mgtSvr, self.port, self.user,
65-
self.passwd, self.apiKey,
66-
self.securityKey,
67-
self.asyncTimeout, self.logging,
68-
self.protocol,
65+
return cloudConnection(self.mgtDetails,
66+
self.asyncTimeout,
67+
self.logging,
6968
self.path)
7069

7170
def loglevel(self, lvl=logging.WARNING):

tools/marvin/marvin/cloudstackTestClient.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ def __init__(self, mgmtDetails,
4141
dbSvrDetails, asyncTimeout=3600,
4242
defaultWorkerThreads=10,
4343
logging=None):
44+
self.mgmtDetails = mgmtDetails
4445
self.connection = \
45-
cloudstackConnection.cloudConnection(mgmtDetails,
46+
cloudstackConnection.cloudConnection(self.mgmtDetails,
4647
asyncTimeout,
4748
logging)
4849
self.apiClient =\
@@ -148,12 +149,12 @@ def createUserApiClient(self, UserName, DomainName, acctType=0):
148149
apiKey = registerUserRes.apikey
149150
securityKey = registerUserRes.secretkey
150151

152+
mgtDetails = self.mgmtDetails
153+
mgtDetails.apiKey = apiKey
154+
mgtDetails.securityKey = securityKey
155+
151156
newUserConnection =\
152-
cloudstackConnection.cloudConnection(self.connection.mgtSvr,
153-
self.connection.port,
154-
self.connection.user,
155-
self.connection.passwd,
156-
apiKey, securityKey,
157+
cloudstackConnection.cloudConnection(mgtDetails,
157158
self.connection.asyncTimeout,
158159
self.connection.logging)
159160
self.userApiClient =\

tools/marvin/marvin/integration/lib/utils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,7 @@ def fetch_api_client(config_file='datacenterCfg'):
157157
asyncTimeout = 3600
158158
return cloudstackAPIClient.CloudStackAPIClient(
159159
marvin.cloudstackConnection.cloudConnection(
160-
mgt.mgtSvrIp,
161-
mgt.port,
162-
mgt.apiKey,
163-
mgt.securityKey,
160+
mgt,
164161
asyncTimeout,
165162
testClientLogger
166163
)

tools/marvin/marvin/sandbox/demo/simulator/testcase/libs/utils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,7 @@ def fetch_api_client(config_file='datacenterCfg'):
7676
asyncTimeout = 3600
7777
return cloudstackAPIClient.CloudStackAPIClient(
7878
cloudstackConnection.cloudConnection(
79-
mgt.mgtSvrIp,
80-
mgt.port,
81-
mgt.apiKey,
82-
mgt.securityKey,
79+
mgt,
8380
asyncTimeout,
8481
testClientLogger
8582
)

0 commit comments

Comments
 (0)