Skip to content
Prev Previous commit
Next Next commit
CLOUDSTACK-8556: Unable to delete attached volume in cleanup
  • Loading branch information
pritisarap12 committed Jun 25, 2015
commit ac39399c5bbf330a777e4eca0c5b3667523870f5
16 changes: 11 additions & 5 deletions test/integration/testpaths/testpath_snapshot_limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,24 @@ def setUp(self):
self.dbclient = self.testClient.getDbConnection()
self.cleanup = []
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleanup has to be declared before skipping the test case

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated testpath as per the review comment.



def tearDown(self):
try:
data_volumes_list = Volume.list(
self.userapiclient,
id=self.data_volume_created.id,
virtualmachineid=self.vm.id
)
if data_volumes_list:
self.vm.detach_volume(
self.userapiclient,
data_volumes_list[0]
)
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]
)

cleanup_resources(self.apiclient, self.cleanup)
except Exception as e:
Expand Down