]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Clean up some codes about compute in VolumeTestCase
authorRongze Zhu <zrzhit@gmail.com>
Fri, 7 Sep 2012 06:47:51 +0000 (14:47 +0800)
committerRongze Zhu <zrzhit@gmail.com>
Fri, 7 Sep 2012 06:47:51 +0000 (14:47 +0800)
self.compute have not be assigned in VolumeTestCase, so clean up some
codes about it.

Change-Id: Ie2577065ad27b4ee5b54dec65adfe723bf93985f

cinder/tests/test_volume.py

index 8c0513968b6c64fbbbb621a4834fba793d0a440c..ef07156367b482b77c22338272de170c5759068a 100644 (file)
@@ -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")