cleanup call on super (#10807)

This commit is contained in:
dahn 2025-05-09 12:54:32 +02:00 committed by GitHub
parent ea32a1a71a
commit 0a090f4853
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 12 deletions

View File

@ -99,9 +99,12 @@ class TestCreateAffinityGroup(cloudstackTestCase):
cls.api_client = cls.testClient.getApiClient()
cls.services = Services().services
cls._cleanup = []
#Get Zone, Domain and templates
cls.rootdomain = get_domain(cls.api_client)
cls.domain = Domain.create(cls.api_client, cls.services["domain"])
cls._cleanup.append(cls.domain)
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
cls.template = get_template(
@ -177,21 +180,11 @@ class TestCreateAffinityGroup(cloudstackTestCase):
self.cleanup = []
def tearDown(self):
try:
# #Clean up, terminate the created instance, volumes and snapshots
cleanup_resources(self.apiclient, self.cleanup)
except Exception as e:
raise Exception("Warning: Exception during cleanup : %s" % e)
return
super(TestCreateAffinityGroup, self).tearDownClass()
@classmethod
def tearDownClass(cls):
try:
#Clean up, terminate the created templates
cls.domain.delete(cls.api_client, cleanup=True)
cleanup_resources(cls.api_client, cls._cleanup)
except Exception as e:
raise Exception("Warning: Exception during cleanup : %s" % e)
super(TestCreateAffinityGroup, cls).tearDownClass()
def create_aff_grp(self, api_client=None, aff_grp=None, aff_grp_name=None, projectid=None):