RBD: Remove volume_tmp_dir option

Remove the volume_tmp_dir option, now this
defaults to image_conversion_dir.

Change-Id: I700c8937cffe6dfc41feea59e0e04cd75228473c
This commit is contained in:
Eric Harney 2016-12-22 11:20:17 -05:00
parent 5e41a40f29
commit e73995308f
3 changed files with 8 additions and 14 deletions

View File

@ -151,7 +151,6 @@ class RBDTestCase(test.TestCase):
super(RBDTestCase, self).setUp()
self.cfg = mock.Mock(spec=conf.Configuration)
self.cfg.volume_tmp_dir = None
self.cfg.image_conversion_dir = None
self.cfg.rbd_cluster_name = 'nondefault'
self.cfg.rbd_pool = 'rbd'
@ -804,13 +803,11 @@ class RBDTestCase(test.TestCase):
@common_mocks
def test_copy_image_no_volume_tmp(self):
self.cfg.volume_tmp_dir = None
self.cfg.image_conversion_dir = None
self._copy_image()
@common_mocks
def test_copy_image_volume_tmp(self):
self.cfg.volume_tmp_dir = None
self.cfg.image_conversion_dir = '/var/run/cinder/tmp'
self._copy_image()

View File

@ -65,11 +65,6 @@ RBD_OPTS = [
cfg.StrOpt('rbd_secret_uuid',
help='The libvirt uuid of the secret for the rbd_user '
'volumes'),
cfg.StrOpt('volume_tmp_dir',
help='Directory where temporary image files are stored '
'when the volume driver does not write them directly '
'to the volume. Warning: this option is now deprecated, '
'please use image_conversion_dir instead.'),
cfg.IntOpt('rbd_max_clone_depth',
default=5,
help='Maximum number of nested volume clones that are '
@ -840,14 +835,9 @@ class RBDDriver(driver.TransferVD, driver.ExtendVD,
return ({}, False)
def _image_conversion_dir(self):
tmpdir = (self.configuration.volume_tmp_dir or
CONF.image_conversion_dir or
tmpdir = (CONF.image_conversion_dir or
tempfile.gettempdir())
if tmpdir == self.configuration.volume_tmp_dir:
LOG.warning(_LW('volume_tmp_dir is now deprecated, please use '
'image_conversion_dir.'))
# ensure temporary directory exists
if not os.path.exists(tmpdir):
os.makedirs(tmpdir)

View File

@ -0,0 +1,7 @@
---
upgrade:
- The RBD driver no longer uses the "volume_tmp_dir"
option to set where temporary files for image conversion
are stored. Set "image_conversion_dir" to configure this
in Ocata.