Skip to content

Commit

Permalink
Move volume_clear and clear_size opts up to driver
Browse files Browse the repository at this point in the history
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
  • Loading branch information
j-griffith committed Aug 6, 2013
1 parent 580c993 commit 8aac388
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
11 changes: 9 additions & 2 deletions cinder/volume/driver.py
Expand Up @@ -21,7 +21,6 @@
"""

import os
import socket
import time

from oslo.config import cfg
Expand Down Expand Up @@ -82,7 +81,15 @@
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)
Expand Down
7 changes: 0 additions & 7 deletions cinder/volume/drivers/block_device.py
Expand Up @@ -34,13 +34,6 @@
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
Expand Down
2 changes: 0 additions & 2 deletions cinder/volume/drivers/lvm.py
Expand Up @@ -55,8 +55,6 @@

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):
Expand Down

0 comments on commit 8aac388

Please sign in to comment.