Centralize vif,xenpool & vol_utils config options

This change moves config options of
xenserver module from
vif.py, pool.py and volume_utils.py
to centralize location
nova/conf/xenserver.py

Change-Id: I07bfaac36b4a8021788617958196b676d5b2b173
Implements: blueprint centralize-config-options-newton
This commit is contained in:
Pushkar Umaranikar
2016-04-06 21:17:52 +00:00
parent 5ddda6712a
commit fadde1dc92
5 changed files with 28 additions and 34 deletions

View File

@@ -351,12 +351,35 @@ xenapi_vmops_opts = [
help='Dom0 plugin driver used to handle image uploads.'),
]
xenapi_volume_utils_opts = [
cfg.IntOpt('introduce_vdi_retry_wait',
default=20,
help='Number of seconds to wait for an SR to settle '
'if the VDI does not exist when first introduced'),
]
xenapi_ovs_integration_bridge_opts = [
cfg.StrOpt('ovs_integration_bridge',
default='xapi1',
help='Name of Integration Bridge used by Open vSwitch'),
]
xenapi_pool_opts = [
cfg.BoolOpt('use_join_force',
default=True,
help='To use for hosts with different CPUs'),
]
ALL_XENSERVER_OPTS = (xenapi_agent_opts +
xenapi_session_opts +
xenapi_torrent_opts +
xenapi_vm_utils_opts +
xenapi_opts +
xenapi_vmops_opts)
xenapi_vmops_opts +
xenapi_volume_utils_opts +
xenapi_ovs_integration_bridge_opts +
xenapi_pool_opts)
def register_opts(conf):

View File

@@ -29,10 +29,7 @@ import nova.virt.libvirt.volume.scality
import nova.virt.libvirt.volume.smbfs
import nova.virt.libvirt.volume.volume
import nova.virt.xenapi.agent
import nova.virt.xenapi.pool
import nova.virt.xenapi.vif
import nova.virt.xenapi.vmops
import nova.virt.xenapi.volume_utils
def list_opts():
@@ -56,10 +53,4 @@ def list_opts():
nova.virt.libvirt.volume.scality.volume_opts,
nova.virt.libvirt.volume.smbfs.volume_opts,
)),
('xenserver',
itertools.chain(
[nova.virt.xenapi.vif.xenapi_ovs_integration_bridge_opt],
nova.virt.xenapi.pool.xenapi_pool_opts,
nova.virt.xenapi.volume_utils.xenapi_volume_utils_opts,
)),
]

View File

@@ -17,7 +17,6 @@
Management class for Pool-related functions (join, eject, etc).
"""
from oslo_config import cfg
from oslo_log import log as logging
from oslo_serialization import jsonutils
import six
@@ -32,14 +31,7 @@ from nova.virt.xenapi import vm_utils
LOG = logging.getLogger(__name__)
xenapi_pool_opts = [
cfg.BoolOpt('use_join_force',
default=True,
help='To use for hosts with different CPUs'),
]
CONF = nova.conf.CONF
CONF.register_opts(xenapi_pool_opts, 'xenserver')
class ResourcePool(object):

View File

@@ -17,9 +17,9 @@
"""VIF drivers for XenAPI."""
from oslo_config import cfg
from oslo_log import log as logging
import nova.conf
from nova import exception
from nova.i18n import _
from nova.i18n import _LW
@@ -27,12 +27,7 @@ from nova.virt.xenapi import network_utils
from nova.virt.xenapi import vm_utils
xenapi_ovs_integration_bridge_opt = cfg.StrOpt('ovs_integration_bridge',
default='xapi1',
help='Name of Integration Bridge used by Open vSwitch')
CONF = cfg.CONF
CONF.register_opt(xenapi_ovs_integration_bridge_opt, 'xenserver')
CONF = nova.conf.CONF
LOG = logging.getLogger(__name__)

View File

@@ -23,24 +23,17 @@ import string
import uuid
from eventlet import greenthread
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import strutils
from oslo_utils import versionutils
import six
import nova.conf
from nova import exception
from nova.i18n import _, _LE, _LW
xenapi_volume_utils_opts = [
cfg.IntOpt('introduce_vdi_retry_wait',
default=20,
help='Number of seconds to wait for an SR to settle '
'if the VDI does not exist when first introduced'),
]
CONF = cfg.CONF
CONF.register_opts(xenapi_volume_utils_opts, 'xenserver')
CONF = nova.conf.CONF
LOG = logging.getLogger(__name__)