@@ -44,6 +44,7 @@ def setUpClass(cls):
4444 cls .domain = get_domain (cls .apiclient )
4545 cls .zone = get_zone (cls .apiclient , cls .testClient .getZoneForTests ())
4646 cls .hypervisor = cls .testClient .getHypervisorInfo ()
47+ cls ._cleanup = []
4748
4849 cls .template = get_test_template (
4950 cls .apiclient ,
@@ -56,23 +57,22 @@ def setUpClass(cls):
5657 cls .apiclient ,
5758 cls .testdata ["service_offering" ]
5859 )
60+ cls ._cleanup .append (cls .service_offering )
5961
6062 cls .disk_offering = DiskOffering .create (
6163 cls .apiclient ,
6264 cls .testdata ["disk_offering" ]
6365 )
66+ cls ._cleanup .append (cls .disk_offering )
6467
65- cls ._cleanup = [
66- cls .service_offering ,
67- cls .disk_offering
68- ]
6968 return
7069
7170 def setUp (self ):
7271
7372 self .apiclient = self .testClient .getApiClient ()
7473 self .dbclient = self .testClient .getDbConnection ()
7574 self .hypervisor = self .testClient .getHypervisorInfo ()
75+ self .cleanup = []
7676 self .testdata ["virtual_machine" ]["zoneid" ] = self .zone .id
7777 self .testdata ["virtual_machine" ]["template" ] = self .template .id
7878 self .testdata ["iso" ]["zoneid" ] = self .zone .id
@@ -81,7 +81,7 @@ def setUp(self):
8181 self .testdata ["account" ],
8282 domainid = self .domain .id
8383 )
84- self .cleanup = [ self .account ]
84+ self .cleanup . append ( self .account )
8585 return
8686
8787 @attr (
@@ -162,7 +162,7 @@ def test_deploy_vm_from_iso(self):
162162 VirtualMachine .RUNNING
163163 )
164164
165- response = self .virtual_machine .getState (
165+ response = self .virtual_machine .getState (
166166 self .apiclient ,
167167 VirtualMachine .RUNNING )
168168 self .assertEqual (response [0 ], PASS , response [1 ])
0 commit comments