Config options: remove import_opts from completed section

The config options of the "nova.conf" sections got moved to the
new central location "nova/conf/". Otherwise, some modules are
still using import_opts method from these sections, instead of
CONF.<option>. This patch aim to eliminate all import_opts
from below completed sections:
- floating_ips
- cloudpipe
- compute
- key_manager
- network

Change-Id: I7192bf629d3292f9f6501b9d8e3c15545a1f815f
Implements: blueprint centralize-config-options-newton
This commit is contained in:
Hieu LE 2016-05-12 17:01:12 +07:00
parent be22885793
commit 5252f337f4
15 changed files with 10 additions and 30 deletions

View File

@ -26,7 +26,6 @@ from nova.i18n import _
from nova import objects from nova import objects
CONF = nova.conf.CONF CONF = nova.conf.CONF
CONF.import_opt('default_floating_pool', 'nova.network.floating_ips')
ALIAS = 'os-floating-ips-bulk' ALIAS = 'os-floating-ips-bulk'

View File

@ -24,7 +24,6 @@ from nova.i18n import _
from nova import objects from nova import objects
CONF = nova.conf.CONF CONF = nova.conf.CONF
CONF.import_opt('default_floating_pool', 'nova.network.floating_ips')
authorize = extensions.extension_authorizer('compute', 'floating_ips_bulk') authorize = extensions.extension_authorizer('compute', 'floating_ips_bulk')

View File

@ -15,16 +15,13 @@
"""Extension for hiding server addresses in certain states.""" """Extension for hiding server addresses in certain states."""
from oslo_config import cfg
from nova.api.openstack import extensions from nova.api.openstack import extensions
from nova.api.openstack import wsgi from nova.api.openstack import wsgi
from nova.compute import vm_states from nova.compute import vm_states
import nova.conf
CONF = cfg.CONF CONF = nova.conf.CONF
CONF.import_opt('osapi_hide_server_address_states',
'nova.api.openstack.compute.hide_server_addresses')
authorize = extensions.soft_extension_authorizer('compute', authorize = extensions.soft_extension_authorizer('compute',
'hide_server_addresses') 'hide_server_addresses')

View File

@ -87,7 +87,6 @@ from nova import utils
from nova import version from nova import version
CONF = nova.conf.CONF CONF = nova.conf.CONF
CONF.import_opt('default_floating_pool', 'nova.network.floating_ips')
CONF.import_opt('connection', 'oslo_db.options', group='database') CONF.import_opt('connection', 'oslo_db.options', group='database')
QUOTAS = quota.QUOTAS QUOTAS = quota.QUOTAS

View File

@ -35,7 +35,6 @@ from nova import utils
from nova import version from nova import version
CONF = nova.conf.CONF CONF = nova.conf.CONF
CONF.import_opt('network_topic', 'nova.network.rpcapi')
LOG = logging.getLogger('nova.network') LOG = logging.getLogger('nova.network')

View File

@ -40,7 +40,6 @@ LOG = logging.getLogger(__name__)
QUOTAS = quota.QUOTAS QUOTAS = quota.QUOTAS
CONF = nova.conf.CONF CONF = nova.conf.CONF
CONF.import_opt('network_topic', 'nova.network.rpcapi')
class FloatingIP(object): class FloatingIP(object):

View File

@ -64,7 +64,6 @@ from nova import utils
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
CONF = nova.conf.CONF CONF = nova.conf.CONF
CONF.import_opt('network_topic', 'nova.network.rpcapi')
class RPCAllocateFixedIP(object): class RPCAllocateFixedIP(object):

View File

@ -43,7 +43,6 @@ from nova.pci import whitelist as pci_whitelist
CONF = nova.conf.CONF CONF = nova.conf.CONF
CONF.import_opt('default_floating_pool', 'nova.network.floating_ips')
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
soft_external_network_attach_authorize = extensions.soft_core_authorizer( soft_external_network_attach_authorize = extensions.soft_core_authorizer(

View File

@ -18,7 +18,6 @@ from nova import context
from nova.tests.functional.api_sample_tests import api_sample_base from nova.tests.functional.api_sample_tests import api_sample_base
CONF = nova.conf.CONF CONF = nova.conf.CONF
CONF.import_opt('default_floating_pool', 'nova.network.floating_ips')
CONF.import_opt('osapi_compute_extension', CONF.import_opt('osapi_compute_extension',
'nova.api.openstack.compute.legacy_v2.extensions') 'nova.api.openstack.compute.legacy_v2.extensions')

View File

@ -18,7 +18,6 @@ from nova import context
from nova.tests.functional.api_sample_tests import api_sample_base from nova.tests.functional.api_sample_tests import api_sample_base
CONF = nova.conf.CONF CONF = nova.conf.CONF
CONF.import_opt('default_floating_pool', 'nova.network.floating_ips')
CONF.import_opt('osapi_compute_extension', CONF.import_opt('osapi_compute_extension',
'nova.api.openstack.compute.legacy_v2.extensions') 'nova.api.openstack.compute.legacy_v2.extensions')

View File

@ -14,16 +14,14 @@
import datetime import datetime
from oslo_config import cfg import nova.conf
from nova import test from nova import test
from nova.tests import fixtures as nova_fixtures from nova.tests import fixtures as nova_fixtures
from nova.tests.functional.api import client as api_client from nova.tests.functional.api import client as api_client
from nova.tests.unit.image import fake as fake_image from nova.tests.unit.image import fake as fake_image
from nova.tests.unit import policy_fixture from nova.tests.unit import policy_fixture
CONF = cfg.CONF CONF = nova.conf.CONF
CONF.import_opt('null_kernel', 'nova.compute.api')
class TestServerGet(test.TestCase): class TestServerGet(test.TestCase):

View File

@ -15,12 +15,12 @@
import uuid as uuid_lib import uuid as uuid_lib
from oslo_config import cfg
from oslo_utils import timeutils from oslo_utils import timeutils
from webob import exc from webob import exc
from nova.api.openstack.compute import cloudpipe as cloudpipe_v21 from nova.api.openstack.compute import cloudpipe as cloudpipe_v21
from nova.compute import utils as compute_utils from nova.compute import utils as compute_utils
import nova.conf
from nova import exception from nova import exception
from nova import objects from nova import objects
from nova import test from nova import test
@ -29,8 +29,7 @@ from nova.tests.unit import fake_network
from nova.tests.unit import matchers from nova.tests.unit import matchers
from nova import utils from nova import utils
CONF = cfg.CONF CONF = nova.conf.CONF
CONF.import_opt('vpn_image_id', 'nova.cloudpipe.pipelib')
project_id = str(uuid_lib.uuid4().hex) project_id = str(uuid_lib.uuid4().hex)

View File

@ -24,9 +24,6 @@ from nova import ipv6
from nova.tests.unit import utils from nova.tests.unit import utils
CONF = nova.conf.CONF CONF = nova.conf.CONF
CONF.import_opt('floating_ip_dns_manager', 'nova.network.floating_ips')
CONF.import_opt('instance_dns_manager', 'nova.network.floating_ips')
CONF.import_opt('api_class', 'nova.keymgr', group='key_manager')
class ConfFixture(config_fixture.Config): class ConfFixture(config_fixture.Config):

View File

@ -21,16 +21,15 @@ import binascii
import codecs import codecs
from castellan.common.objects import symmetric_key as key from castellan.common.objects import symmetric_key as key
from oslo_config import cfg
import nova.conf
from nova import context from nova import context
from nova import exception from nova import exception
from nova.keymgr import conf_key_mgr from nova.keymgr import conf_key_mgr
from nova import test from nova import test
CONF = cfg.CONF CONF = nova.conf.CONF
CONF.import_opt('fixed_key', 'nova.keymgr.conf_key_mgr', group='key_manager')
decode_hex = codecs.getdecoder("hex_codec") decode_hex = codecs.getdecoder("hex_codec")

View File

@ -23,12 +23,12 @@ from castellan import key_manager
import fixtures import fixtures
import mock import mock
from oslo_concurrency import lockutils from oslo_concurrency import lockutils
from oslo_config import cfg
from oslo_config import fixture as config_fixture from oslo_config import fixture as config_fixture
from oslo_utils import imageutils from oslo_utils import imageutils
from oslo_utils import units from oslo_utils import units
from oslo_utils import uuidutils from oslo_utils import uuidutils
import nova.conf
from nova import context from nova import context
from nova import exception from nova import exception
from nova import objects from nova import objects
@ -41,8 +41,7 @@ from nova.virt.libvirt import config as vconfig
from nova.virt.libvirt import imagebackend from nova.virt.libvirt import imagebackend
from nova.virt.libvirt.storage import rbd_utils from nova.virt.libvirt.storage import rbd_utils
CONF = cfg.CONF CONF = nova.conf.CONF
CONF.import_opt('fixed_key', 'nova.keymgr.conf_key_mgr', group='key_manager')
class FakeSecret(object): class FakeSecret(object):