From 7cb17d63f1bd317abc5cacd6d77e7ca810ccc346 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Tue, 8 Jan 2013 09:48:03 +0000 Subject: [PATCH] Move global service networking opts to new module The my_ip, host and use_ipv6 options are used all over the codebase and they're pretty well related to each other. Create a new netconf module for them to live in. There are now no options registered globally in nova.config! blueprint: scope-config-opts Change-Id: Ifde37839ae6f38e6bf99dff1e80b8e25fd68ed25 --- bin/nova-dhcpbridge | 2 +- nova/api/ec2/cloud.py | 2 +- nova/cells/state.py | 1 - nova/compute/manager.py | 6 +- nova/compute/utils.py | 2 +- nova/config.py | 41 ------------ nova/console/xvp.py | 2 +- nova/image/glance.py | 2 +- nova/image/s3.py | 2 +- nova/manager.py | 2 +- nova/netconf.py | 62 +++++++++++++++++++ nova/network/linux_net.py | 6 +- nova/network/manager.py | 4 +- nova/service.py | 2 +- nova/tests/api/ec2/test_cinder_cloud.py | 2 +- nova/tests/api/ec2/test_cloud.py | 2 +- .../api/openstack/compute/test_extensions.py | 1 - nova/tests/api/openstack/fakes.py | 2 +- nova/tests/cells/test_cells_messaging.py | 1 - nova/tests/compute/test_compute.py | 2 +- nova/tests/conf_fixture.py | 1 + nova/tests/fake_network.py | 2 +- nova/tests/integrated/test_extensions.py | 1 - nova/tests/scheduler/test_host_filters.py | 2 +- nova/tests/test_imagecache.py | 2 +- nova/tests/test_libvirt.py | 4 +- nova/tests/test_xenapi.py | 2 +- nova/tests/utils.py | 2 +- nova/virt/baremetal/driver.py | 1 + nova/virt/baremetal/pxe.py | 2 +- nova/virt/baremetal/volume_driver.py | 2 + nova/virt/firewall.py | 2 +- nova/virt/hyperv/basevolumeutils.py | 2 +- nova/virt/hyperv/volumeops.py | 2 +- nova/virt/libvirt/driver.py | 4 +- nova/virt/libvirt/firewall.py | 2 +- nova/virt/libvirt/imagecache.py | 2 +- nova/virt/libvirt/vif.py | 2 +- nova/virt/netutils.py | 2 +- nova/virt/xenapi/driver.py | 2 +- nova/virt/xenapi/pool.py | 2 +- nova/virt/xenapi/vm_utils.py | 2 +- nova/virt/xenapi/vmops.py | 2 +- 43 files changed, 106 insertions(+), 87 deletions(-) create mode 100644 nova/netconf.py diff --git a/bin/nova-dhcpbridge b/bin/nova-dhcpbridge index 582edde99a4c..6187e052d70e 100755 --- a/bin/nova-dhcpbridge +++ b/bin/nova-dhcpbridge @@ -47,7 +47,7 @@ from nova.openstack.common import rpc from nova import utils CONF = cfg.CONF -CONF.import_opt('host', 'nova.config') +CONF.import_opt('host', 'nova.netconf') CONF.import_opt('network_manager', 'nova.service') LOG = logging.getLogger('nova.dhcpbridge') diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index 5dd861e8dac0..73a4a02aea7b 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -71,7 +71,7 @@ ec2_opts = [ CONF = cfg.CONF CONF.register_opts(ec2_opts) -CONF.import_opt('my_ip', 'nova.config') +CONF.import_opt('my_ip', 'nova.netconf') CONF.import_opt('vpn_key_suffix', 'nova.cloudpipe.pipelib') CONF.import_opt('internal_service_availability_zone', 'nova.availability_zones') diff --git a/nova/cells/state.py b/nova/cells/state.py index c6f8f3220204..8fd0e9c7a00e 100644 --- a/nova/cells/state.py +++ b/nova/cells/state.py @@ -38,7 +38,6 @@ cell_state_manager_opts = [ LOG = logging.getLogger(__name__) CONF = cfg.CONF -CONF.import_opt('host', 'nova.config') CONF.import_opt('name', 'nova.cells.opts', group='cells') #CONF.import_opt('capabilities', 'nova.cells.opts', group='cells') CONF.register_opts(cell_state_manager_opts, group='cells') diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 682af2ce5c54..1628c026da1a 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -174,11 +174,9 @@ CONF.register_opts(timeout_opts) CONF.register_opts(running_deleted_opts) CONF.import_opt('allow_resize_to_same_host', 'nova.compute.api') CONF.import_opt('console_topic', 'nova.console.rpcapi') -CONF.import_opt('host', 'nova.config') -CONF.import_opt('my_ip', 'nova.config') +CONF.import_opt('host', 'nova.netconf') +CONF.import_opt('my_ip', 'nova.netconf') CONF.import_opt('network_manager', 'nova.service') -CONF.import_opt('reclaim_instance_interval', 'nova.config') -CONF.import_opt('my_ip', 'nova.config') QUOTAS = quota.QUOTAS diff --git a/nova/compute/utils.py b/nova/compute/utils.py index 6d6b7cac9c56..e8592dbe2822 100644 --- a/nova/compute/utils.py +++ b/nova/compute/utils.py @@ -33,7 +33,7 @@ from nova import utils from nova.virt import driver CONF = cfg.CONF -CONF.import_opt('host', 'nova.config') +CONF.import_opt('host', 'nova.netconf') LOG = log.getLogger(__name__) diff --git a/nova/config.py b/nova/config.py index f3fa8d380b85..4095dba75d36 100644 --- a/nova/config.py +++ b/nova/config.py @@ -17,51 +17,10 @@ # License for the specific language governing permissions and limitations # under the License. -import os -import socket - from nova.openstack.common import cfg from nova.openstack.common import rpc -def _get_my_ip(): - """ - Returns the actual ip of the local machine. - - This code figures out what source address would be used if some traffic - were to be sent out to some well known address on the Internet. In this - case, a Google DNS server is used, but the specific address does not - matter much. No traffic is actually sent. - """ - try: - csock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - csock.connect(('8.8.8.8', 80)) - (addr, port) = csock.getsockname() - csock.close() - return addr - except socket.error: - return "127.0.0.1" - - -global_opts = [ - cfg.StrOpt('my_ip', - default=_get_my_ip(), - help='ip address of this host'), - cfg.StrOpt('host', - default=socket.getfqdn(), - help='Name of this node. This can be an opaque identifier. ' - 'It is not necessarily a hostname, FQDN, or IP address. ' - 'However, the node name must be valid within ' - 'an AMQP key, and if using ZeroMQ, a valid ' - 'hostname, FQDN, or IP address'), - cfg.BoolOpt('use_ipv6', - default=False, - help='use ipv6'), -] - -cfg.CONF.register_opts(global_opts) - - def parse_args(argv, default_config_files=None): rpc.set_defaults(control_exchange='nova') cfg.CONF(argv[1:], diff --git a/nova/console/xvp.py b/nova/console/xvp.py index 7447c5912a45..ce2eb5350848 100644 --- a/nova/console/xvp.py +++ b/nova/console/xvp.py @@ -51,7 +51,7 @@ xvp_opts = [ CONF = cfg.CONF CONF.register_opts(xvp_opts) -CONF.import_opt('host', 'nova.config') +CONF.import_opt('host', 'nova.netconf') LOG = logging.getLogger(__name__) diff --git a/nova/image/glance.py b/nova/image/glance.py index 6a5406d9e928..5a5c187cb143 100644 --- a/nova/image/glance.py +++ b/nova/image/glance.py @@ -64,7 +64,7 @@ LOG = logging.getLogger(__name__) CONF = cfg.CONF CONF.register_opts(glance_opts) CONF.import_opt('auth_strategy', 'nova.api.auth') -CONF.import_opt('my_ip', 'nova.config') +CONF.import_opt('my_ip', 'nova.netconf') def generate_glance_url(): diff --git a/nova/image/s3.py b/nova/image/s3.py index 6cb5e74ac251..31ab6b1fc14e 100644 --- a/nova/image/s3.py +++ b/nova/image/s3.py @@ -68,7 +68,7 @@ s3_opts = [ CONF = cfg.CONF CONF.register_opts(s3_opts) -CONF.import_opt('my_ip', 'nova.config') +CONF.import_opt('my_ip', 'nova.netconf') class S3ImageService(object): diff --git a/nova/manager.py b/nova/manager.py index 636424d1cdd5..cb15b776eb04 100644 --- a/nova/manager.py +++ b/nova/manager.py @@ -75,7 +75,7 @@ periodic_opts = [ CONF = cfg.CONF CONF.register_opts(periodic_opts) -CONF.import_opt('host', 'nova.config') +CONF.import_opt('host', 'nova.netconf') LOG = logging.getLogger(__name__) DEFAULT_INTERVAL = 60.0 diff --git a/nova/netconf.py b/nova/netconf.py new file mode 100644 index 000000000000..531a9e200c98 --- /dev/null +++ b/nova/netconf.py @@ -0,0 +1,62 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# Copyright 2012 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import socket + +from nova.openstack.common import cfg + +CONF = cfg.CONF + + +def _get_my_ip(): + """ + Returns the actual ip of the local machine. + + This code figures out what source address would be used if some traffic + were to be sent out to some well known address on the Internet. In this + case, a Google DNS server is used, but the specific address does not + matter much. No traffic is actually sent. + """ + try: + csock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + csock.connect(('8.8.8.8', 80)) + (addr, port) = csock.getsockname() + csock.close() + return addr + except socket.error: + return "127.0.0.1" + + +netconf_opts = [ + cfg.StrOpt('my_ip', + default=_get_my_ip(), + help='ip address of this host'), + cfg.StrOpt('host', + default=socket.getfqdn(), + help='Name of this node. This can be an opaque identifier. ' + 'It is not necessarily a hostname, FQDN, or IP address. ' + 'However, the node name must be valid within ' + 'an AMQP key, and if using ZeroMQ, a valid ' + 'hostname, FQDN, or IP address'), + cfg.BoolOpt('use_ipv6', + default=False, + help='use ipv6'), +] + +CONF.register_opts(netconf_opts) diff --git a/nova/network/linux_net.py b/nova/network/linux_net.py index f4b39e553f3d..ea09f69b2f77 100644 --- a/nova/network/linux_net.py +++ b/nova/network/linux_net.py @@ -95,9 +95,9 @@ linux_net_opts = [ CONF = cfg.CONF CONF.register_opts(linux_net_opts) -CONF.import_opt('host', 'nova.config') -CONF.import_opt('use_ipv6', 'nova.config') -CONF.import_opt('my_ip', 'nova.config') +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 diff --git a/nova/network/manager.py b/nova/network/manager.py index 0061543c3262..8d9255daca03 100644 --- a/nova/network/manager.py +++ b/nova/network/manager.py @@ -196,8 +196,8 @@ network_opts = [ CONF = cfg.CONF CONF.register_opts(network_opts) -CONF.import_opt('use_ipv6', 'nova.config') -CONF.import_opt('my_ip', 'nova.config') +CONF.import_opt('use_ipv6', 'nova.netconf') +CONF.import_opt('my_ip', 'nova.netconf') class RPCAllocateFixedIP(object): diff --git a/nova/service.py b/nova/service.py index 4418b08402dd..7191da4a8ef1 100644 --- a/nova/service.py +++ b/nova/service.py @@ -112,7 +112,7 @@ service_opts = [ CONF = cfg.CONF CONF.register_opts(service_opts) -CONF.import_opt('host', 'nova.config') +CONF.import_opt('host', 'nova.netconf') class SignalExit(SystemExit): diff --git a/nova/tests/api/ec2/test_cinder_cloud.py b/nova/tests/api/ec2/test_cinder_cloud.py index 7512303ae73d..d403ba1f0dc9 100644 --- a/nova/tests/api/ec2/test_cinder_cloud.py +++ b/nova/tests/api/ec2/test_cinder_cloud.py @@ -40,7 +40,7 @@ from nova import volume CONF = cfg.CONF CONF.import_opt('compute_driver', 'nova.virt.driver') CONF.import_opt('default_instance_type', 'nova.compute.instance_types') -CONF.import_opt('use_ipv6', 'nova.config') +CONF.import_opt('use_ipv6', 'nova.netconf') LOG = logging.getLogger(__name__) diff --git a/nova/tests/api/ec2/test_cloud.py b/nova/tests/api/ec2/test_cloud.py index 21978c300f88..ae2ea11c3e25 100644 --- a/nova/tests/api/ec2/test_cloud.py +++ b/nova/tests/api/ec2/test_cloud.py @@ -53,7 +53,7 @@ from nova import volume CONF = cfg.CONF CONF.import_opt('compute_driver', 'nova.virt.driver') CONF.import_opt('default_instance_type', 'nova.compute.instance_types') -CONF.import_opt('use_ipv6', 'nova.config') +CONF.import_opt('use_ipv6', 'nova.netconf') LOG = logging.getLogger(__name__) HOST = "testhost" diff --git a/nova/tests/api/openstack/compute/test_extensions.py b/nova/tests/api/openstack/compute/test_extensions.py index 494e4473885c..e3810510bb99 100644 --- a/nova/tests/api/openstack/compute/test_extensions.py +++ b/nova/tests/api/openstack/compute/test_extensions.py @@ -32,7 +32,6 @@ from nova.tests.api.openstack import fakes from nova.tests import matchers CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', 'nova.config') NS = "{http://docs.openstack.org/common/api/v1.0}" ATOMNS = "{http://www.w3.org/2005/Atom}" diff --git a/nova/tests/api/openstack/fakes.py b/nova/tests/api/openstack/fakes.py index 9b939b324c4e..03fc87ac58ff 100644 --- a/nova/tests/api/openstack/fakes.py +++ b/nova/tests/api/openstack/fakes.py @@ -151,7 +151,7 @@ def stub_out_instance_quota(stubs, allowed, quota, resource='instances'): def stub_out_networking(stubs): def get_my_ip(): return '127.0.0.1' - stubs.Set(nova.config, '_get_my_ip', get_my_ip) + stubs.Set(nova.netconf, '_get_my_ip', get_my_ip) def stub_out_compute_api_snapshot(stubs): diff --git a/nova/tests/cells/test_cells_messaging.py b/nova/tests/cells/test_cells_messaging.py index d728c9474c30..a5810fb21fba 100644 --- a/nova/tests/cells/test_cells_messaging.py +++ b/nova/tests/cells/test_cells_messaging.py @@ -24,7 +24,6 @@ from nova.tests.cells import fakes CONF = cfg.CONF -CONF.import_opt('host', 'nova.config') CONF.import_opt('name', 'nova.cells.opts', group='cells') CONF.import_opt('allowed_rpc_exception_modules', 'nova.openstack.common.rpc') diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py index 644043ae9851..4603668338aa 100644 --- a/nova/tests/compute/test_compute.py +++ b/nova/tests/compute/test_compute.py @@ -71,7 +71,7 @@ QUOTAS = quota.QUOTAS LOG = logging.getLogger(__name__) CONF = cfg.CONF CONF.import_opt('compute_manager', 'nova.service') -CONF.import_opt('host', 'nova.config') +CONF.import_opt('host', 'nova.netconf') CONF.import_opt('live_migration_retry_count', 'nova.compute.manager') diff --git a/nova/tests/conf_fixture.py b/nova/tests/conf_fixture.py index 010737a0db9a..9155a3f68522 100644 --- a/nova/tests/conf_fixture.py +++ b/nova/tests/conf_fixture.py @@ -25,6 +25,7 @@ from nova import paths from nova.tests.utils import cleanup_dns_managers CONF = cfg.CONF +CONF.import_opt('use_ipv6', 'nova.netconf') CONF.import_opt('scheduler_driver', 'nova.scheduler.manager') CONF.import_opt('fake_network', 'nova.network.manager') CONF.import_opt('network_size', 'nova.network.manager') diff --git a/nova/tests/fake_network.py b/nova/tests/fake_network.py index eefd4d2137aa..b97999e7d42c 100644 --- a/nova/tests/fake_network.py +++ b/nova/tests/fake_network.py @@ -31,7 +31,7 @@ from nova.virt.libvirt import config as libvirt_config HOST = "testhost" CONF = cfg.CONF -CONF.import_opt('use_ipv6', 'nova.config') +CONF.import_opt('use_ipv6', 'nova.netconf') class FakeIptablesFirewallDriver(object): diff --git a/nova/tests/integrated/test_extensions.py b/nova/tests/integrated/test_extensions.py index e23b31e5b9c4..b6e1adc73660 100644 --- a/nova/tests/integrated/test_extensions.py +++ b/nova/tests/integrated/test_extensions.py @@ -22,7 +22,6 @@ from nova.openstack.common.log import logging from nova.tests.integrated import integrated_helpers CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', 'nova.config') LOG = logging.getLogger(__name__) diff --git a/nova/tests/scheduler/test_host_filters.py b/nova/tests/scheduler/test_host_filters.py index 7314c7cc6148..9f7f189cc116 100644 --- a/nova/tests/scheduler/test_host_filters.py +++ b/nova/tests/scheduler/test_host_filters.py @@ -30,7 +30,7 @@ from nova import test from nova.tests.scheduler import fakes CONF = cfg.CONF -CONF.import_opt('my_ip', 'nova.config') +CONF.import_opt('my_ip', 'nova.netconf') class TestFilter(filters.BaseHostFilter): diff --git a/nova/tests/test_imagecache.py b/nova/tests/test_imagecache.py index 618a6bd540b3..eaf244c566d0 100644 --- a/nova/tests/test_imagecache.py +++ b/nova/tests/test_imagecache.py @@ -38,7 +38,7 @@ from nova.virt.libvirt import utils as virtutils CONF = cfg.CONF CONF.import_opt('compute_manager', 'nova.service') -CONF.import_opt('host', 'nova.config') +CONF.import_opt('host', 'nova.netconf') LOG = log.getLogger(__name__) diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py index cce220b20c76..53bb1b9844cc 100644 --- a/nova/tests/test_libvirt.py +++ b/nova/tests/test_libvirt.py @@ -73,8 +73,8 @@ libvirt_driver.libvirt = libvirt CONF = cfg.CONF CONF.import_opt('compute_manager', 'nova.service') -CONF.import_opt('host', 'nova.config') -CONF.import_opt('my_ip', 'nova.config') +CONF.import_opt('host', 'nova.netconf') +CONF.import_opt('my_ip', 'nova.netconf') CONF.import_opt('base_dir_name', 'nova.virt.libvirt.imagecache') LOG = logging.getLogger(__name__) diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py index 5cdc2928b097..b3437db625b0 100644 --- a/nova/tests/test_xenapi.py +++ b/nova/tests/test_xenapi.py @@ -60,7 +60,7 @@ CONF = cfg.CONF CONF.import_opt('compute_manager', 'nova.service') CONF.import_opt('network_manager', 'nova.service') CONF.import_opt('compute_driver', 'nova.virt.driver') -CONF.import_opt('host', 'nova.config') +CONF.import_opt('host', 'nova.netconf') CONF.import_opt('default_availability_zone', 'nova.availability_zones') IMAGE_MACHINE = '1' diff --git a/nova/tests/utils.py b/nova/tests/utils.py index 45d0d295b3aa..00b70ceb3296 100644 --- a/nova/tests/utils.py +++ b/nova/tests/utils.py @@ -23,7 +23,7 @@ from nova.network import minidns from nova.openstack.common import cfg CONF = cfg.CONF -CONF.import_opt('use_ipv6', 'nova.config') +CONF.import_opt('use_ipv6', 'nova.netconf') def get_test_admin_context(): diff --git a/nova/virt/baremetal/driver.py b/nova/virt/baremetal/driver.py index bb76954e1110..39364168cca3 100644 --- a/nova/virt/baremetal/driver.py +++ b/nova/virt/baremetal/driver.py @@ -74,6 +74,7 @@ baremetal_group = cfg.OptGroup(name='baremetal', CONF = cfg.CONF CONF.register_group(baremetal_group) CONF.register_opts(opts, baremetal_group) +CONF.import_opt('host', 'nova.netconf') DEFAULT_FIREWALL_DRIVER = "%s.%s" % ( firewall.__name__, diff --git a/nova/virt/baremetal/pxe.py b/nova/virt/baremetal/pxe.py index 4bb61ad39b45..9dbb4e79e052 100644 --- a/nova/virt/baremetal/pxe.py +++ b/nova/virt/baremetal/pxe.py @@ -70,7 +70,7 @@ baremetal_group = cfg.OptGroup(name='baremetal', CONF = cfg.CONF CONF.register_group(baremetal_group) CONF.register_opts(pxe_opts, baremetal_group) - +CONF.import_opt('use_ipv6', 'nova.netconf') CHEETAH = None diff --git a/nova/virt/baremetal/volume_driver.py b/nova/virt/baremetal/volume_driver.py index 09088dd53028..570cea1d876c 100644 --- a/nova/virt/baremetal/volume_driver.py +++ b/nova/virt/baremetal/volume_driver.py @@ -45,6 +45,8 @@ CONF = cfg.CONF CONF.register_group(baremetal_group) CONF.register_opts(opts, baremetal_group) +CONF.import_opt('host', 'nova.netconf') +CONF.import_opt('use_ipv6', 'nova.netconf') CONF.import_opt('libvirt_volume_drivers', 'nova.virt.libvirt.driver') LOG = logging.getLogger(__name__) diff --git a/nova/virt/firewall.py b/nova/virt/firewall.py index bdfa8fb4e5ca..bbc6034bdcfc 100644 --- a/nova/virt/firewall.py +++ b/nova/virt/firewall.py @@ -41,7 +41,7 @@ firewall_opts = [ CONF = cfg.CONF CONF.register_opts(firewall_opts) -CONF.import_opt('use_ipv6', 'nova.config') +CONF.import_opt('use_ipv6', 'nova.netconf') def load_driver(default, *args, **kwargs): diff --git a/nova/virt/hyperv/basevolumeutils.py b/nova/virt/hyperv/basevolumeutils.py index c6ac8b644a51..2352c3befb50 100644 --- a/nova/virt/hyperv/basevolumeutils.py +++ b/nova/virt/hyperv/basevolumeutils.py @@ -33,7 +33,7 @@ if sys.platform == 'win32': LOG = logging.getLogger(__name__) CONF = cfg.CONF -CONF.import_opt('my_ip', 'nova.config') +CONF.import_opt('my_ip', 'nova.netconf') class BaseVolumeUtils(object): diff --git a/nova/virt/hyperv/volumeops.py b/nova/virt/hyperv/volumeops.py index ed80e0f1bcdb..20023623324e 100644 --- a/nova/virt/hyperv/volumeops.py +++ b/nova/virt/hyperv/volumeops.py @@ -45,7 +45,7 @@ hyper_volumeops_opts = [ CONF = cfg.CONF CONF.register_opts(hyper_volumeops_opts) -CONF.import_opt('my_ip', 'nova.config') +CONF.import_opt('my_ip', 'nova.netconf') class VolumeOps(baseops.BaseOps): diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 1f75c7ee2a28..ea6e0e6a0c18 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -190,8 +190,8 @@ libvirt_opts = [ CONF = cfg.CONF CONF.register_opts(libvirt_opts) -CONF.import_opt('host', 'nova.config') -CONF.import_opt('my_ip', 'nova.config') +CONF.import_opt('host', 'nova.netconf') +CONF.import_opt('my_ip', 'nova.netconf') CONF.import_opt('default_ephemeral_format', 'nova.virt.driver') CONF.import_opt('use_cow_images', 'nova.virt.driver') CONF.import_opt('live_migration_retry_count', 'nova.compute.manager') diff --git a/nova/virt/libvirt/firewall.py b/nova/virt/libvirt/firewall.py index c52b0c56ed46..c47056ff2e90 100644 --- a/nova/virt/libvirt/firewall.py +++ b/nova/virt/libvirt/firewall.py @@ -27,7 +27,7 @@ import nova.virt.firewall as base_firewall LOG = logging.getLogger(__name__) CONF = cfg.CONF -CONF.import_opt('use_ipv6', 'nova.config') +CONF.import_opt('use_ipv6', 'nova.netconf') try: import libvirt diff --git a/nova/virt/libvirt/imagecache.py b/nova/virt/libvirt/imagecache.py index db5e6e05825c..50fac9bb4d47 100644 --- a/nova/virt/libvirt/imagecache.py +++ b/nova/virt/libvirt/imagecache.py @@ -72,7 +72,7 @@ imagecache_opts = [ CONF = cfg.CONF CONF.register_opts(imagecache_opts) -CONF.import_opt('host', 'nova.config') +CONF.import_opt('host', 'nova.netconf') CONF.import_opt('instances_path', 'nova.compute.manager') diff --git a/nova/virt/libvirt/vif.py b/nova/virt/libvirt/vif.py index f0467439599c..1dc30f73ef79 100644 --- a/nova/virt/libvirt/vif.py +++ b/nova/virt/libvirt/vif.py @@ -42,7 +42,7 @@ libvirt_vif_opts = [ CONF = cfg.CONF CONF.register_opts(libvirt_vif_opts) CONF.import_opt('libvirt_type', 'nova.virt.libvirt.driver') -CONF.import_opt('use_ipv6', 'nova.config') +CONF.import_opt('use_ipv6', 'nova.netconf') LINUX_DEV_LEN = 14 diff --git a/nova/virt/netutils.py b/nova/virt/netutils.py index 727b7aac6dab..70f1544c48d8 100644 --- a/nova/virt/netutils.py +++ b/nova/virt/netutils.py @@ -26,7 +26,7 @@ import netaddr from nova.openstack.common import cfg CONF = cfg.CONF -CONF.import_opt('use_ipv6', 'nova.config') +CONF.import_opt('use_ipv6', 'nova.netconf') CONF.import_opt('injected_network_template', 'nova.virt.disk.api') Template = None diff --git a/nova/virt/xenapi/driver.py b/nova/virt/xenapi/driver.py index b54fdcda0c87..bdb73b28fb6b 100644 --- a/nova/virt/xenapi/driver.py +++ b/nova/virt/xenapi/driver.py @@ -117,7 +117,7 @@ xenapi_opts = [ CONF = cfg.CONF CONF.register_opts(xenapi_opts) -CONF.import_opt('host', 'nova.config') +CONF.import_opt('host', 'nova.netconf') class XenAPIDriver(driver.ComputeDriver): diff --git a/nova/virt/xenapi/pool.py b/nova/virt/xenapi/pool.py index 1855789ebbb0..1682f18d11d4 100644 --- a/nova/virt/xenapi/pool.py +++ b/nova/virt/xenapi/pool.py @@ -39,7 +39,7 @@ xenapi_pool_opts = [ CONF = cfg.CONF CONF.register_opts(xenapi_pool_opts) -CONF.import_opt('host', 'nova.config') +CONF.import_opt('host', 'nova.netconf') class ResourcePool(object): diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py index b489538753ba..40d43da8dd6c 100644 --- a/nova/virt/xenapi/vm_utils.py +++ b/nova/virt/xenapi/vm_utils.py @@ -126,7 +126,7 @@ CONF.register_opts(xenapi_vm_utils_opts) CONF.import_opt('default_ephemeral_format', 'nova.virt.driver') CONF.import_opt('use_cow_images', 'nova.virt.driver') CONF.import_opt('glance_num_retries', 'nova.image.glance') -CONF.import_opt('use_ipv6', 'nova.config') +CONF.import_opt('use_ipv6', 'nova.netconf') XENAPI_POWER_STATE = { 'Halted': power_state.SHUTDOWN, diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py index 430944a8e4dc..e8e0f3cb03ab 100644 --- a/nova/virt/xenapi/vmops.py +++ b/nova/virt/xenapi/vmops.py @@ -63,7 +63,7 @@ xenapi_vmops_opts = [ CONF = cfg.CONF CONF.register_opts(xenapi_vmops_opts) -CONF.import_opt('host', 'nova.config') +CONF.import_opt('host', 'nova.netconf') CONF.import_opt('vncserver_proxyclient_address', 'nova.vnc') DEFAULT_FIREWALL_DRIVER = "%s.%s" % (