CLOUDSTACK-7682: Fixed usage event issue. Used api client of account for which we are checking the usage

Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>
This commit is contained in:
Gaurav Aradhye 2014-10-08 11:25:15 +05:30 committed by SrikanteswaraRao Talluri
parent a1e7feead9
commit b9fed951ef
1 changed files with 5 additions and 2 deletions

View File

@ -669,6 +669,9 @@ class TestTemplateUsage(cloudstackTestCase):
domainid=cls.domain.id
)
cls._cleanup.append(cls.account)
cls.userapiclient = cls.testClient.getUserApiClient(
UserName=cls.account.name,
DomainName=cls.account.domain)
cls.services["account"] = cls.account.name
cls.service_offering = ServiceOffering.create(
@ -742,7 +745,7 @@ class TestTemplateUsage(cloudstackTestCase):
#Create template from Virtual machine and Volume ID
self.template = Template.create(
self.apiclient,
self.userapiclient,
self.services["templates"],
self.volume.id,
TestTemplateUsage.account.name,
@ -750,7 +753,7 @@ class TestTemplateUsage(cloudstackTestCase):
)
self.debug("Created template with ID: %s" % self.template.id)
# Delete template
self.template.delete(self.apiclient)
self.template.delete(self.userapiclient)
self.debug("Deleted template with ID: %s" % self.template.id)
# Fetch account ID from account_uuid