Repository: cloudstack Updated Branches: refs/heads/master ad420bb1d -> a4d0af213
CLOUDSTACK-9005: Modifying tearDown function Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d793c7f5 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d793c7f5 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d793c7f5 Branch: refs/heads/master Commit: d793c7f50ff56a3ecdd6c8862df1ee67ebcc9ac4 Parents: 3ded3e9 Author: Priti Sarap <priti.sa...@clogeny.com> Authored: Thu Oct 29 10:58:15 2015 +0530 Committer: Priti Sarap <priti.sa...@clogeny.com> Committed: Thu Oct 29 10:58:15 2015 +0530 ---------------------------------------------------------------------- .../testpaths/testpath_snapshot_limits.py | 33 ++++++++++---------- 1 file changed, 17 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d793c7f5/test/integration/testpaths/testpath_snapshot_limits.py ---------------------------------------------------------------------- diff --git a/test/integration/testpaths/testpath_snapshot_limits.py b/test/integration/testpaths/testpath_snapshot_limits.py index a99f053..855d3a2 100644 --- a/test/integration/testpaths/testpath_snapshot_limits.py +++ b/test/integration/testpaths/testpath_snapshot_limits.py @@ -123,24 +123,25 @@ class TestStorageSnapshotsLimits(cloudstackTestCase): "Snapshots are not supported on %s" % self.hypervisor) - def tearDown(self): try: - data_volumes_list = Volume.list( - self.userapiclient, - id=self.data_volume_created.id, - virtualmachineid=self.vm.id - ) - status = validateList(data_volumes_list) - self.assertEqual( - status[0], - PASS, - "DATA Volume List Validation Failed") - - self.vm.detach_volume( - self.userapiclient, - data_volumes_list[0] - ) + if hasattr(self, "data_volume_created"): + data_volumes_list = Volume.list( + self.userapiclient, + id=self.data_volume_created.id, + virtualmachineid=self.vm.id + ) + status = validateList(data_volumes_list) + self.assertEqual( + status[0], + PASS, + "DATA Volume List Validation Failed") + + if data_volumes_list: + self.vm.detach_volume( + self.userapiclient, + data_volumes_list[0] + ) cleanup_resources(self.apiclient, self.cleanup) except Exception as e: