]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Removing flags in RBD in favor of configuration
authorMike Perez <thingee@gmail.com>
Sat, 9 Mar 2013 07:46:33 +0000 (23:46 -0800)
committerMike Perez <thingee@gmail.com>
Sat, 9 Mar 2013 08:22:14 +0000 (00:22 -0800)
Not needed since we're using configuration for multi-backend support.

Change-Id: I9634fca5d09ca84ef793e330def13176265dac31

cinder/tests/test_rbd.py
cinder/volume/drivers/rbd.py

index f0f1266513e997aaf4dbecd694a50875e7bc9c8a..8db5445559b9a92ef879b69eae1ace8463a1dfb6 100644 (file)
@@ -80,15 +80,15 @@ class RBDTestCase(test.TestCase):
         def fake_execute(*args, **kwargs):
             return '', ''
         self._mox = mox.Mox()
-        configuration = mox.MockObject(conf.Configuration)
-        configuration.volume_tmp_dir = None
-        configuration.rbd_pool = 'rbd'
-        configuration.rbd_secret_uuid = None
-        configuration.rbd_user = None
-        configuration.append_config_values(mox.IgnoreArg())
+        self.configuration = mox.MockObject(conf.Configuration)
+        self.configuration.volume_tmp_dir = None
+        self.configuration.rbd_pool = 'rbd'
+        self.configuration.rbd_secret_uuid = None
+        self.configuration.rbd_user = None
+        self.configuration.append_config_values(mox.IgnoreArg())
 
         self.driver = RBDDriver(execute=fake_execute,
-                                configuration=configuration)
+                                configuration=self.configuration)
         self._mox.ReplayAll()
 
     def test_good_locations(self):
@@ -143,11 +143,11 @@ class RBDTestCase(test.TestCase):
                                          FakeImageService(), None)
 
     def test_copy_image_no_volume_tmp(self):
-        self.flags(volume_tmp_dir=None)
+        self.configuration.volume_tmp_dir = None
         self._copy_image()
 
     def test_copy_image_volume_tmp(self):
-        self.flags(volume_tmp_dir='/var/run/cinder/tmp')
+        self.configuration.volume_tmp_dir = '/var/run/cinder/tmp'
         self._copy_image()
 
     def test_update_volume_stats(self):
index 0fb3559153147988ec84c5ecd56fd30409c7ea9a..c9016bf8bf3546216190e9ff6e6b5dc7b2334040 100644 (file)
@@ -23,7 +23,6 @@ import urllib
 from oslo.config import cfg
 
 from cinder import exception
-from cinder import flags
 from cinder.image import image_utils
 from cinder.openstack.common import log as logging
 from cinder import utils
@@ -47,9 +46,6 @@ rbd_opts = [
                help='where to store temporary image files if the volume '
                     'driver does not write them directly to the volume'), ]
 
-FLAGS = flags.FLAGS
-FLAGS.register_opts(rbd_opts)
-
 VERSION = '1.0'