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):
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):
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
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'