From 463f854af107ecbae9186895e2e44f87a907bde1 Mon Sep 17 00:00:00 2001 From: Hieu LE Date: Fri, 22 Apr 2016 16:51:52 +0700 Subject: [PATCH] Config options: centralize glusterfs libvirt options (9) 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 9th patch in a long-chain patchs. Change-Id: I0f6c9c2ecbf053a64c4af6ec2877d637b6506cb0 Co-Authored-by: Markus Zoeller Implements: blueprint centralize-config-options-newton --- nova/conf/libvirt.py | 10 ++++++++++ nova/virt/libvirt/volume/glusterfs.py | 11 ----------- nova/virt/opts.py | 2 -- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/nova/conf/libvirt.py b/nova/conf/libvirt.py index 9c4c89cd7f8c..8a70e690c933 100644 --- a/nova/conf/libvirt.py +++ b/nova/conf/libvirt.py @@ -15,6 +15,8 @@ import itertools +from nova.conf import paths + from oslo_config import cfg # Downtime period in milliseconds @@ -303,6 +305,13 @@ libvirt_volume_aoe_opts = [ help='Number of times to rediscover AoE target to find volume'), ] +libvirt_volume_glusterfs_opts = [ + cfg.StrOpt('glusterfs_mount_point_base', + default=paths.state_path_def('mnt'), + help='Directory where the glusterfs volume is mounted on the ' + 'compute node'), +] + ALL_OPTS = list(itertools.chain( libvirt_general_opts, libvirt_imagebackend_opts, @@ -312,6 +321,7 @@ ALL_OPTS = list(itertools.chain( libvirt_vif_opts, libvirt_volume_opts, libvirt_volume_aoe_opts, + libvirt_volume_glusterfs_opts, )) diff --git a/nova/virt/libvirt/volume/glusterfs.py b/nova/virt/libvirt/volume/glusterfs.py index 1f72dedc8320..f07b3c9d0ae1 100644 --- a/nova/virt/libvirt/volume/glusterfs.py +++ b/nova/virt/libvirt/volume/glusterfs.py @@ -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,15 +23,6 @@ from nova.virt.libvirt.volume import fs CONF = nova.conf.CONF -volume_opts = [ - cfg.StrOpt('glusterfs_mount_point_base', - default=paths.state_path_def('mnt'), - help='Directory where the glusterfs volume is mounted on the ' - 'compute node'), - ] - -CONF.register_opts(volume_opts, 'libvirt') - LOG = logging.getLogger(__name__) diff --git a/nova/virt/opts.py b/nova/virt/opts.py index 4fd735aa8775..b4020185769a 100644 --- a/nova/virt/opts.py +++ b/nova/virt/opts.py @@ -12,7 +12,6 @@ import itertools -import nova.virt.libvirt.volume.glusterfs import nova.virt.libvirt.volume.iscsi import nova.virt.libvirt.volume.iser import nova.virt.libvirt.volume.net @@ -32,7 +31,6 @@ def list_opts(): return [ ('libvirt', itertools.chain( - nova.virt.libvirt.volume.glusterfs.volume_opts, nova.virt.libvirt.volume.iscsi.volume_opts, nova.virt.libvirt.volume.iser.volume_opts, nova.virt.libvirt.volume.net.volume_opts,