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>
This commit is contained in:
Santhosh Edukulla 2013-11-11 03:30:09 +05:30 committed by Prasanna Santhanam
parent f629d405eb
commit 175ead4ea9
4 changed files with 15 additions and 21 deletions

View File

@ -36,7 +36,7 @@ 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'):
path='client/api'):
self.loglevel() # Turn off requests logs
self.apiKey = mgmtDet.apiKey
self.securityKey = mgmtDet.securityKey
@ -49,7 +49,8 @@ class cloudConnection(object):
self.logging = logging
self.path = path
self.retries = 5
self.protocol = scheme
self.mgtDetails = mgmtDet
self.protocol = "http"
self.asyncTimeout = asyncTimeout
self.auth = True
if self.port == 8096 or \
@ -61,11 +62,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

@ -41,8 +41,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 =\
@ -148,12 +149,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
)