From: John Griffith Date: Tue, 6 Aug 2013 20:58:02 +0000 (-0600) Subject: Move volume_clear and clear_size opts up to driver X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=8aac388cc091b6c79c2d0650810acf72a1097446;p=openstack-build%2Fcinder-build.git Move volume_clear and clear_size opts up to driver The block_device driver pulled in the clear and clear_size options for it's own use and broke the inheritance model needed for multiple backend configs. This change moves the two configs up higher in the heirarchy to driver.py so that it can be shared/used by all drivers if they desire. This means that they are now set properly in volume_opts. At some point we shoudl restructure this a bit to allow multi-backends to specify independent settings for these configs. Fixes bug: 1208964 Change-Id: I6afbdecea637f7e7d3417be537ab71fe97bffda3 --- diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py index 086725f89..ec7280879 100644 --- a/cinder/volume/driver.py +++ b/cinder/volume/driver.py @@ -21,7 +21,6 @@ Drivers for volumes. """ import os -import socket import time from oslo.config import cfg @@ -82,7 +81,15 @@ volume_opts = [ cfg.BoolOpt('use_multipath_for_image_xfer', default=False, help='Do we attach/detach volumes in cinder using multipath ' - 'for volume to image and image to volume transfers?'), ] + 'for volume to image and image to volume transfers?'), + cfg.StrOpt('volume_clear', + default='zero', + help='Method used to wipe old voumes (valid options are: ' + 'none, zero, shred)'), + cfg.IntOpt('volume_clear_size', + default=0, + help='Size in MiB to wipe at start of old volumes. 0 => all'), ] + CONF = cfg.CONF CONF.register_opts(volume_opts) diff --git a/cinder/volume/drivers/block_device.py b/cinder/volume/drivers/block_device.py index f4edbaa94..4b1ad2fdd 100644 --- a/cinder/volume/drivers/block_device.py +++ b/cinder/volume/drivers/block_device.py @@ -34,13 +34,6 @@ volume_opts = [ cfg.ListOpt('available_devices', default=[], help='List of all available devices'), - cfg.IntOpt('volume_clear_size', - default=0, - help='Size in MiB to wipe at start of old volumes. 0 => all'), - cfg.StrOpt('volume_clear', - default='zero', - help='Method used to wipe old volumes (valid options are: ' - 'none, zero, shred)'), ] CONF = cfg.CONF diff --git a/cinder/volume/drivers/lvm.py b/cinder/volume/drivers/lvm.py index 0847e9c16..6b5414297 100644 --- a/cinder/volume/drivers/lvm.py +++ b/cinder/volume/drivers/lvm.py @@ -55,8 +55,6 @@ volume_opts = [ CONF = cfg.CONF CONF.register_opts(volume_opts) -CONF.import_opt('volume_clear', 'cinder.volume.drivers.block_device') -CONF.import_opt('volume_clear_size', 'cinder.volume.drivers.block_device') class LVMVolumeDriver(driver.VolumeDriver):