From e73995308fccc9ae1f8d956d3ceeecca76fec14f Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Thu, 22 Dec 2016 11:20:17 -0500 Subject: [PATCH] RBD: Remove volume_tmp_dir option Remove the volume_tmp_dir option, now this defaults to image_conversion_dir. Change-Id: I700c8937cffe6dfc41feea59e0e04cd75228473c --- cinder/tests/unit/volume/drivers/test_rbd.py | 3 --- cinder/volume/drivers/rbd.py | 12 +----------- ...emove_volume_tmp_dir_option-c83c5341e5a42378.yaml | 7 +++++++ 3 files changed, 8 insertions(+), 14 deletions(-) create mode 100644 releasenotes/notes/remove_volume_tmp_dir_option-c83c5341e5a42378.yaml diff --git a/cinder/tests/unit/volume/drivers/test_rbd.py b/cinder/tests/unit/volume/drivers/test_rbd.py index 43a58573fbb..4fe605ffc67 100644 --- a/cinder/tests/unit/volume/drivers/test_rbd.py +++ b/cinder/tests/unit/volume/drivers/test_rbd.py @@ -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() diff --git a/cinder/volume/drivers/rbd.py b/cinder/volume/drivers/rbd.py index 888ed83e45e..f7874cbaf10 100644 --- a/cinder/volume/drivers/rbd.py +++ b/cinder/volume/drivers/rbd.py @@ -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) diff --git a/releasenotes/notes/remove_volume_tmp_dir_option-c83c5341e5a42378.yaml b/releasenotes/notes/remove_volume_tmp_dir_option-c83c5341e5a42378.yaml new file mode 100644 index 00000000000..0763cbc9956 --- /dev/null +++ b/releasenotes/notes/remove_volume_tmp_dir_option-c83c5341e5a42378.yaml @@ -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. +