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>

Conflicts:

	tools/marvin/marvin/cloudstackConnection.py
This commit is contained in:
Santhosh Edukulla 2013-11-11 03:30:09 +05:30 committed by Gaurav Aradhye
parent 42941b3376
commit e82fe01692
4 changed files with 15 additions and 20 deletions

View File

@ -34,7 +34,8 @@ from requests import RequestException
class cloudConnection(object):
""" Connections to make API calls to the cloudstack management server
"""
def __init__(self, mgmtDet,asyncTimeout=3600, logging=None, scheme='http',path='client/api'):
def __init__(self, mgmtDet, asyncTimeout=3600, logging=None,
path='client/api'):
self.loglevel() # Turn off requests logs
self.apiKey = mgmtDet.apiKey
self.securityKey = mgmtDet.securityKey
@ -47,6 +48,7 @@ class cloudConnection(object):
self.logging = logging
self.path = path
self.retries = 5
self.mgtDetails = mgmtDet
self.protocol = "http"
self.asyncTimeout = asyncTimeout
self.auth = True
@ -59,11 +61,9 @@ class cloudConnection(object):
% (self.protocol, self.mgtSvr, self.port, self.path)
def __copy__(self):
return cloudConnection(self.mgtSvr, self.port, self.user,
self.passwd, self.apiKey,
self.securityKey,
self.asyncTimeout, self.logging,
self.protocol,
return cloudConnection(self.mgtDetails,
self.asyncTimeout,
self.logging,
self.path)
def loglevel(self, lvl=logging.WARNING):

View File

@ -52,8 +52,9 @@ class cloudstackTestClient(object):
dbSvrDetails, asyncTimeout=3600,
defaultWorkerThreads=10,
logging=None):
self.mgmtDetails = mgmtDetails
self.connection = \
cloudstackConnection.cloudConnection(mgmtDetails,
cloudstackConnection.cloudConnection(self.mgmtDetails,
asyncTimeout,
logging)
self.apiClient =\
@ -158,12 +159,12 @@ class cloudstackTestClient(object):
apiKey = registerUserRes.apikey
securityKey = registerUserRes.secretkey
mgtDetails = self.mgmtDetails
mgtDetails.apiKey = apiKey
mgtDetails.securityKey = securityKey
newUserConnection =\
cloudstackConnection.cloudConnection(self.connection.mgtSvr,
self.connection.port,
self.connection.user,
self.connection.passwd,
apiKey, securityKey,
cloudstackConnection.cloudConnection(mgtDetails,
self.connection.asyncTimeout,
self.connection.logging)
self.userApiClient =\

View File

@ -157,10 +157,7 @@ def fetch_api_client(config_file='datacenterCfg'):
asyncTimeout = 3600
return cloudstackAPIClient.CloudStackAPIClient(
marvin.cloudstackConnection.cloudConnection(
mgt.mgtSvrIp,
mgt.port,
mgt.apiKey,
mgt.securityKey,
mgt,
asyncTimeout,
testClientLogger
)

View File

@ -76,10 +76,7 @@ def fetch_api_client(config_file='datacenterCfg'):
asyncTimeout = 3600
return cloudstackAPIClient.CloudStackAPIClient(
cloudstackConnection.cloudConnection(
mgt.mgtSvrIp,
mgt.port,
mgt.apiKey,
mgt.securityKey,
mgt,
asyncTimeout,
testClientLogger
)