From: Rongze Zhu Date: Fri, 7 Sep 2012 06:47:51 +0000 (+0800) Subject: Clean up some codes about compute in VolumeTestCase X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=a17fc22b4d26b351a11aa5f3d4a2688cf46f007b;p=openstack-build%2Fcinder-build.git 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 --- 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")