From a17fc22b4d26b351a11aa5f3d4a2688cf46f007b Mon Sep 17 00:00:00 2001 From: Rongze Zhu Date: Fri, 7 Sep 2012 14:47:51 +0800 Subject: [PATCH] Clean up some codes about compute in VolumeTestCase self.compute have not be assigned in VolumeTestCase, so clean up some codes about it. Change-Id: Ie2577065ad27b4ee5b54dec65adfe723bf93985f --- cinder/tests/test_volume.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/cinder/tests/test_volume.py b/cinder/tests/test_volume.py index 8c0513968..ef0715636 100644 --- a/cinder/tests/test_volume.py +++ b/cinder/tests/test_volume.py @@ -194,14 +194,7 @@ class VolumeTestCase(test.TestCase): volume = self._create_volume() volume_id = volume['id'] self.volume.create_volume(self.context, volume_id) - if FLAGS.fake_tests: - db.volume_attached(self.context, volume_id, instance_uuid, - mountpoint) - else: - self.compute.attach_volume(self.context, - instance_uuid, - volume_id, - mountpoint) + db.volume_attached(self.context, volume_id, instance_uuid, mountpoint) vol = db.volume_get(context.get_admin_context(), volume_id) self.assertEqual(vol['status'], "in-use") self.assertEqual(vol['attach_status'], "attached") @@ -212,13 +205,7 @@ class VolumeTestCase(test.TestCase): self.volume.delete_volume, self.context, volume_id) - if FLAGS.fake_tests: - db.volume_detached(self.context, volume_id) - else: - pass - self.compute.detach_volume(self.context, - instance_uuid, - volume_id) + db.volume_detached(self.context, volume_id) vol = db.volume_get(self.context, volume_id) self.assertEqual(vol['status'], "available") -- 2.45.2