Config options: centralize volume nfs libvirt options (13)

The config options of the "nova.conf" section "libvirt" got
moved to the new central location "nova/conf/libvirt.py".
Subsequent patches will then move another options in libvirt section.
This is the 13th patch in a long-chain patchs.

Change-Id: I435b083892b2f05896c991b7fd1d1a9ba3e0978b
Co-Authored-by: Markus Zoeller <mzoeller@de.ibm.com>
Implements: blueprint centralize-config-options-newton
This commit is contained in:
Hieu LE 2016-04-22 18:39:45 +07:00
parent 643aed652d
commit 8778a9ea7c
3 changed files with 11 additions and 15 deletions

View File

@ -351,6 +351,16 @@ libvirt_volume_net_opts = [
'volumes'),
]
libvirt_volume_nfs_opts = [
cfg.StrOpt('nfs_mount_point_base',
default=paths.state_path_def('mnt'),
help='Directory where the NFS volume is mounted on the'
' compute node'),
cfg.StrOpt('nfs_mount_options',
help='Mount options passed to the NFS client. See section '
'of the nfs man page for details'),
]
ALL_OPTS = list(itertools.chain(
libvirt_general_opts,
libvirt_imagebackend_opts,
@ -364,6 +374,7 @@ ALL_OPTS = list(itertools.chain(
libvirt_volume_iscsi_opts,
libvirt_volume_iser_opts,
libvirt_volume_net_opts,
libvirt_volume_nfs_opts,
))

View File

@ -12,12 +12,10 @@
from oslo_concurrency import processutils
from oslo_config import cfg
from oslo_log import log as logging
import six
import nova.conf
from nova.conf import paths
from nova.i18n import _LE, _LW
from nova import utils
from nova.virt.libvirt import utils as libvirt_utils
@ -25,18 +23,7 @@ from nova.virt.libvirt.volume import fs
LOG = logging.getLogger(__name__)
volume_opts = [
cfg.StrOpt('nfs_mount_point_base',
default=paths.state_path_def('mnt'),
help='Directory where the NFS volume is mounted on the'
' compute node'),
cfg.StrOpt('nfs_mount_options',
help='Mount options passed to the NFS client. See section '
'of the nfs man page for details'),
]
CONF = nova.conf.CONF
CONF.register_opts(volume_opts, 'libvirt')
class LibvirtNFSVolumeDriver(fs.LibvirtBaseFileSystemVolumeDriver):

View File

@ -12,7 +12,6 @@
import itertools
import nova.virt.libvirt.volume.nfs
import nova.virt.libvirt.volume.quobyte
import nova.virt.libvirt.volume.remotefs
import nova.virt.libvirt.volume.scality
@ -28,7 +27,6 @@ def list_opts():
return [
('libvirt',
itertools.chain(
nova.virt.libvirt.volume.nfs.volume_opts,
nova.virt.libvirt.volume.quobyte.volume_opts,
nova.virt.libvirt.volume.remotefs.libvirt_opts,
nova.virt.libvirt.volume.scality.volume_opts,