CLOUDSTACK-7368: Fixed network cleanup issue in test_add_remove_network.py

Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ac805355
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ac805355
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ac805355

Branch: refs/heads/saml2
Commit: ac8053557427e4345b0c8c98421ac8fa776dace8
Parents: 76d050b
Author: Gaurav Aradhye <gaurav.arad...@clogeny.com>
Authored: Wed Aug 20 12:27:27 2014 +0530
Committer: Girish Shilamkar <gir...@clogeny.com>
Committed: Thu Aug 21 11:34:44 2014 +0530

----------------------------------------------------------------------
 test/integration/component/test_add_remove_network.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ac805355/test/integration/component/test_add_remove_network.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_add_remove_network.py 
b/test/integration/component/test_add_remove_network.py
index 34af7bc..9b57761 100644
--- a/test/integration/component/test_add_remove_network.py
+++ b/test/integration/component/test_add_remove_network.py
@@ -579,6 +579,7 @@ class TestAddNetworkToVirtualMachine(cloudstackTestCase):
             self.services["shared_network_2"]["vlan"] = 
get_free_vlan(self.apiclient, self.zone.id)[1]
             network = 
Network.create(self.api_client,self.services["shared_network_2"],account.name,
                                      account.domainid, 
networkofferingid=self.shared_network_offering.id)
+            self.cleanup.append(network)
 
         if network is None:
             self.skipTest("Network should not be none. Case not handled for 
Network of type %s" % value)
@@ -632,9 +633,10 @@ class TestAddNetworkToVirtualMachine(cloudstackTestCase):
                                     domainid=self.child_domain_2.id)
             tempCleanupList.append(self.child_do_admin_2)
         except Exception as e:
+            self.fail(e)
+        finally:
             tempCleanupList.reverse()
             self.cleanup += tempCleanupList
-            self.fail(e)
 
         network = 
Network.create(self.api_client,self.services["isolated_network"],self.child_do_admin_1.name,
                                      
self.child_do_admin_1.domainid,networkofferingid=self.isolated_network_offering.id)

Reply via email to