Config options: Centralize netconf options

The config options of the section
"nova/netconf" got moved to the
new central location
"nova/conf/netconf.py"

Change-Id: I8a17b6f00b15e03de55385fc0206bdc82441304a
Depends-On: I0da2ad7daa942b85c3395dc4861c6e18368ece88
Implements: blueprint centralize-config-options-newton
This commit is contained in:
Pushkar Umaranikar 2016-03-17 20:30:39 +00:00
parent c9fbba7661
commit d619ad6ba1
39 changed files with 33 additions and 71 deletions

View File

@ -42,7 +42,6 @@ from nova.objects import base as objects_base
from nova import rpc
CONF = nova.conf.CONF
CONF.import_opt('host', 'nova.netconf')
LOG = logging.getLogger(__name__)

View File

@ -98,7 +98,6 @@ from nova import volume
from nova.volume import encryptors
CONF = nova.conf.CONF
CONF.import_opt('host', 'nova.netconf')
LOG = logging.getLogger(__name__)

View File

@ -45,8 +45,6 @@ CONF = nova.conf.CONF
LOG = logging.getLogger(__name__)
COMPUTE_RESOURCE_SEMAPHORE = "compute_resources"
CONF.import_opt('my_ip', 'nova.netconf')
def _instance_in_resize_state(instance):
"""Returns True if the instance is in one of the resizing states.

View File

@ -19,13 +19,13 @@ import string
import traceback
import netifaces
from oslo_config import cfg
from oslo_log import log
import six
from nova import block_device
from nova.compute import power_state
from nova.compute import task_states
import nova.conf
from nova import exception
from nova.i18n import _LW
from nova.network import model as network_model
@ -35,8 +35,7 @@ from nova import rpc
from nova import utils
from nova.virt import driver
CONF = cfg.CONF
CONF.import_opt('host', 'nova.netconf')
CONF = nova.conf.CONF
LOG = log.getLogger(__name__)

View File

@ -57,6 +57,7 @@ from nova.conf import mks
# from nova.conf import matchmaker_redis
# from nova.conf import metadata
# from nova.conf import metrics
from nova.conf import netconf
from nova.conf import network
from nova.conf import neutron
from nova.conf import notifications
@ -126,6 +127,7 @@ keymgr.register_opts(CONF)
# matchmaker_redis.register_opts(CONF)
# metadata.register_opts(CONF)
# metrics.register_opts(CONF)
netconf.register_opts(CONF)
network.register_opts(CONF)
neutron.register_opts(CONF)
notifications.register_opts(CONF)

View File

@ -20,8 +20,6 @@ import socket
from oslo_config import cfg
from oslo_utils import netutils
CONF = cfg.CONF
netconf_opts = [
cfg.StrOpt('my_ip',
@ -42,4 +40,10 @@ netconf_opts = [
help='Use IPv6'),
]
CONF.register_opts(netconf_opts)
def register_opts(conf):
conf.register_opts(netconf_opts)
def list_opts():
return {'DEFAULT': netconf_opts}

View File

@ -31,7 +31,6 @@ from nova import utils
CONF = nova.conf.CONF
CONF.import_opt('host', 'nova.netconf')
LOG = logging.getLogger(__name__)

View File

@ -32,6 +32,7 @@ from oslo_log import log as logging
from nova.api.ec2 import ec2utils
import nova.cert.rpcapi
from nova.compute import arch
import nova.conf
from nova import exception
from nova.i18n import _, _LE, _LI
from nova.image import glance
@ -68,9 +69,8 @@ s3_opts = [
'when downloading from S3'),
]
CONF = cfg.CONF
CONF = nova.conf.CONF
CONF.register_opts(s3_opts)
CONF.import_opt('my_ip', 'nova.netconf')
class S3ImageService(object):

View File

@ -51,15 +51,14 @@ This module provides Manager, a base class for managers.
"""
from oslo_config import cfg
from oslo_service import periodic_task
import nova.conf
from nova.db import base
from nova import rpc
CONF = cfg.CONF
CONF.import_opt('host', 'nova.netconf')
CONF = nova.conf.CONF
class PeriodicTasks(periodic_task.PeriodicTasks):

View File

@ -46,9 +46,6 @@ LOG = logging.getLogger(__name__)
CONF = nova.conf.CONF
CONF.import_opt('host', 'nova.netconf')
CONF.import_opt('use_ipv6', 'nova.netconf')
CONF.import_opt('my_ip', 'nova.netconf')
# NOTE(vish): Iptables supports chain names of up to 28 characters, and we

View File

@ -64,8 +64,6 @@ from nova import utils
LOG = logging.getLogger(__name__)
CONF = nova.conf.CONF
CONF.import_opt('use_ipv6', 'nova.netconf')
CONF.import_opt('my_ip', 'nova.netconf')
CONF.import_opt('network_topic', 'nova.network.rpcapi')

View File

@ -26,7 +26,6 @@ import nova.db.base
import nova.db.sqlalchemy.api
import nova.exception
import nova.image.download.file
import nova.netconf
import nova.servicegroup.api
import nova.volume
import nova.volume.cinder
@ -41,7 +40,6 @@ def list_opts():
nova.db.api.db_opts,
nova.db.sqlalchemy.api.db_opts,
nova.exception.exc_log_opts,
nova.netconf.netconf_opts,
nova.volume._volume_opts,
)),
('cinder', nova.volume.cinder.cinder_opts),

View File

@ -46,7 +46,6 @@ from nova import wsgi
LOG = logging.getLogger(__name__)
CONF = nova.conf.CONF
CONF.import_opt('host', 'nova.netconf')
def _create_service_ref(this_service, context):

View File

@ -37,10 +37,10 @@ from nova.api.openstack import wsgi as os_wsgi
from nova.compute import api as compute_api
from nova.compute import flavors
from nova.compute import vm_states
import nova.conf
from nova import context
from nova.db.sqlalchemy import models
from nova import exception as exc
import nova.netconf
from nova import objects
from nova.objects import base
from nova import quota

View File

@ -99,7 +99,6 @@ from nova.volume import cinder
QUOTAS = quota.QUOTAS
LOG = logging.getLogger(__name__)
CONF = nova.conf.CONF
CONF.import_opt('host', 'nova.netconf')
FAKE_IMAGE_REF = uuids.image_ref

View File

@ -24,8 +24,6 @@ from nova import ipv6
from nova.tests.unit import utils
CONF = nova.conf.CONF
CONF.import_opt('use_ipv6', 'nova.netconf')
CONF.import_opt('host', 'nova.netconf')
CONF.import_opt('floating_ip_dns_manager', 'nova.network.floating_ips')
CONF.import_opt('instance_dns_manager', 'nova.network.floating_ips')

View File

@ -13,12 +13,13 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from oslo_serialization import jsonutils
from six.moves import range
from nova.compute import api as compute_api
from nova.compute import manager as compute_manager
import nova.conf
import nova.context
from nova import db
from nova import exception
@ -36,8 +37,7 @@ from nova.tests import uuidsentinel as uuids
HOST = "testhost"
CONF = cfg.CONF
CONF.import_opt('use_ipv6', 'nova.netconf')
CONF = nova.conf.CONF
class FakeModel(dict):

View File

@ -11,16 +11,14 @@
# under the License.
import mock
from oslo_config import cfg
import nova.conf
from nova import objects
from nova.scheduler.filters import affinity_filter
from nova import test
from nova.tests.unit.scheduler import fakes
CONF = cfg.CONF
CONF.import_opt('my_ip', 'nova.netconf')
CONF = nova.conf.CONF
class TestDifferentHostFilter(test.NoDBTestCase):

View File

@ -17,10 +17,10 @@ import platform
import socket
import sys
from oslo_config import cfg
from six.moves import range
from nova.compute import flavors
import nova.conf
import nova.context
import nova.db
from nova import exception
@ -30,8 +30,7 @@ from nova.network import model as network_model
from nova import objects
import nova.utils
CONF = cfg.CONF
CONF.import_opt('use_ipv6', 'nova.netconf')
CONF = nova.conf.CONF
def get_test_admin_context():

View File

@ -108,8 +108,6 @@ libvirt_guest.libvirt = fakelibvirt
CONF = nova.conf.CONF
CONF.import_opt('host', 'nova.netconf')
CONF.import_opt('my_ip', 'nova.netconf')
_fake_network_info = fake_network.fake_get_instance_nw_info

View File

@ -39,7 +39,6 @@ from nova.virt.libvirt import imagecache
from nova.virt.libvirt import utils as libvirt_utils
CONF = nova.conf.CONF
CONF.import_opt('host', 'nova.netconf')
@contextlib.contextmanager

View File

@ -67,7 +67,6 @@ from nova.virt.vmwareapi import vmops
from nova.virt.vmwareapi import volumeops
CONF = nova.conf.CONF
CONF.import_opt('host', 'nova.netconf')
def _fake_create_session(inst):

View File

@ -74,7 +74,6 @@ from nova.virt.xenapi import volume_utils
LOG = logging.getLogger(__name__)
CONF = nova.conf.CONF
CONF.import_opt('host', 'nova.netconf')
IMAGE_MACHINE = '1'
IMAGE_KERNEL = '2'

View File

@ -26,7 +26,6 @@ semantics of real hypervisor connections.
import collections
import contextlib
from oslo_config import cfg
from oslo_log import log as logging
from oslo_serialization import jsonutils
from oslo_utils import versionutils
@ -36,6 +35,7 @@ from nova.compute import hv_type
from nova.compute import power_state
from nova.compute import task_states
from nova.compute import vm_mode
import nova.conf
from nova.console import type as ctype
from nova import exception
from nova.i18n import _LW
@ -44,8 +44,7 @@ from nova.virt import driver
from nova.virt import hardware
from nova.virt import virtapi
CONF = cfg.CONF
CONF.import_opt('host', 'nova.netconf')
CONF = nova.conf.CONF
LOG = logging.getLogger(__name__)

View File

@ -30,7 +30,6 @@ from nova.virt import netutils
LOG = logging.getLogger(__name__)
CONF = nova.conf.CONF
CONF.import_opt('use_ipv6', 'nova.netconf')
def load_driver(default, *args, **kwargs):

View File

@ -23,7 +23,6 @@ import time
from os_win import constants as os_win_const
from os_win import utilsfactory
from oslo_config import cfg
from oslo_log import log as logging
from oslo_serialization import jsonutils
from oslo_utils import units
@ -31,12 +30,12 @@ from oslo_utils import units
from nova.compute import arch
from nova.compute import hv_type
from nova.compute import vm_mode
import nova.conf
from nova.i18n import _
from nova.virt.hyperv import constants
from nova.virt.hyperv import pathutils
CONF = cfg.CONF
CONF.import_opt('my_ip', 'nova.netconf')
CONF = nova.conf.CONF
LOG = logging.getLogger(__name__)

View File

@ -38,8 +38,6 @@ from nova.virt import driver
LOG = logging.getLogger(__name__)
CONF = nova.conf.CONF
CONF.import_opt('host', 'nova.netconf')
CONF.import_opt('my_ip', 'nova.netconf')
class VolumeOps(object):

View File

@ -20,7 +20,6 @@ from nova import objects
from nova.virt import block_device as driver_block_device
CONF = nova.conf.CONF
CONF.import_opt('host', 'nova.netconf')
class ImageCacheManager(object):

View File

@ -314,8 +314,6 @@ libvirt_opts = [
CONF = nova.conf.CONF
CONF.register_opts(libvirt_opts, 'libvirt')
CONF.import_opt('host', 'nova.netconf')
CONF.import_opt('my_ip', 'nova.netconf')
CONF.import_opt('hw_disk_discard', 'nova.virt.libvirt.imagebackend',
group='libvirt')
CONF.import_opt('iscsi_use_multipath', 'nova.virt.libvirt.volume.iscsi',

View File

@ -31,7 +31,6 @@ from nova.virt import netutils
LOG = logging.getLogger(__name__)
CONF = nova.conf.CONF
CONF.import_opt('use_ipv6', 'nova.netconf')
libvirt = None

View File

@ -37,7 +37,6 @@ from eventlet import greenio
from eventlet import greenthread
from eventlet import patcher
from eventlet import tpool
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
from oslo_utils import importutils
@ -45,6 +44,7 @@ from oslo_utils import units
from oslo_utils import versionutils
import six
import nova.conf
from nova import context as nova_context
from nova import exception
from nova.i18n import _
@ -65,9 +65,7 @@ native_socket = patcher.original('socket')
native_threading = patcher.original("threading")
native_Queue = patcher.original("Queue" if six.PY2 else "queue")
CONF = cfg.CONF
CONF.import_opt('host', 'nova.netconf')
CONF.import_opt('my_ip', 'nova.netconf')
CONF = nova.conf.CONF
# This list is for libvirt hypervisor drivers that need special handling.

View File

@ -24,6 +24,7 @@ from oslo_concurrency import processutils
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 _LE
@ -43,9 +44,8 @@ libvirt_vif_opts = [
help='Use virtio for bridge interfaces with KVM/QEMU'),
]
CONF = cfg.CONF
CONF = nova.conf.CONF
CONF.register_opts(libvirt_vif_opts, 'libvirt')
CONF.import_opt('use_ipv6', 'nova.netconf')
# vhostuser queues support
MIN_LIBVIRT_VHOSTUSER_MQ = (1, 2, 17)

View File

@ -28,7 +28,6 @@ import nova.conf
from nova.network import model
CONF = nova.conf.CONF
CONF.import_opt('use_ipv6', 'nova.netconf')
def get_net_and_mask(cidr):

View File

@ -63,7 +63,6 @@ from nova.virt.vmwareapi import vm_util
CONF = nova.conf.CONF
CONF.import_opt('my_ip', 'nova.netconf')
LOG = logging.getLogger(__name__)

View File

@ -46,9 +46,7 @@ from nova.virt.xenapi import pool_states
LOG = logging.getLogger(__name__)
CONF = nova.conf.CONF
CONF.import_opt('host', 'nova.netconf')
def apply_session_helpers(session):

View File

@ -45,7 +45,6 @@ from nova.virt.xenapi import volumeops
LOG = logging.getLogger(__name__)
CONF = nova.conf.CONF
CONF.import_opt('host', 'nova.netconf')
OVERHEAD_BASE = 3
OVERHEAD_PER_MB = 0.00781

View File

@ -24,6 +24,7 @@ import six
import six.moves.urllib.parse as urlparse
from nova.compute import rpcapi as compute_rpcapi
import nova.conf
from nova import exception
from nova.i18n import _, _LE
from nova.virt.xenapi import pool_states
@ -37,9 +38,8 @@ xenapi_pool_opts = [
help='To use for hosts with different CPUs'),
]
CONF = cfg.CONF
CONF = nova.conf.CONF
CONF.register_opts(xenapi_pool_opts, 'xenserver')
CONF.import_opt('host', 'nova.netconf')
class ResourcePool(object):

View File

@ -62,7 +62,6 @@ from nova.virt.xenapi.image import utils as image_utils
LOG = logging.getLogger(__name__)
CONF = nova.conf.CONF
CONF.import_opt('use_ipv6', 'nova.netconf')
XENAPI_POWER_STATE = {
'Halted': power_state.SHUTDOWN,

View File

@ -64,7 +64,6 @@ LOG = logging.getLogger(__name__)
CONF = nova.conf.CONF
CONF.import_opt('host', 'nova.netconf')
DEFAULT_FIREWALL_DRIVER = "%s.%s" % (
firewall.__name__,