mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-7444: Allowing user account to submit async jobs in addition to admin
This commit is contained in:
parent
6827d677a4
commit
a1dc17125b
@ -615,8 +615,13 @@ class TestCreateSnapshot(cloudstackTestCase):
|
||||
self.debug("Create a template from snapshot: %s" % snapshot.name)
|
||||
jobs.append(self.create_Template_from_Snapshot(snapshot))
|
||||
|
||||
|
||||
userapiclient = self.testClient.getUserApiClient(
|
||||
UserName=self.account.name,
|
||||
DomainName=self.account.domain)
|
||||
|
||||
# Verify IO usage by submitting the concurrent jobs
|
||||
self.testClient.submitCmdsAndWait(jobs)
|
||||
self.testClient.submitCmdsAndWait(jobs, apiclient=userapiclient)
|
||||
|
||||
self.debug("Verifying if templates are created properly or not?")
|
||||
templates = Template.list(
|
||||
|
||||
@ -417,12 +417,14 @@ class CSTestClient(object):
|
||||
return FAILED
|
||||
return self.__createUserApiClient(UserName, DomainName, type)
|
||||
|
||||
def submitCmdsAndWait(self, cmds, workers=1):
|
||||
def submitCmdsAndWait(self, cmds, workers=1, apiclient=None):
|
||||
'''
|
||||
@Desc : FixME, httplib has issue if more than one thread submitted
|
||||
'''
|
||||
if not apiclient:
|
||||
apiclient = self.__apiClient
|
||||
if self.__asyncJobMgr is None:
|
||||
self.__asyncJobMgr = asyncJobMgr(self.__apiClient,
|
||||
self.__asyncJobMgr = asyncJobMgr(apiclient,
|
||||
self.__dbConnection)
|
||||
return self.__asyncJobMgr.submitCmdsAndWait(cmds, workers)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user