Remove unused CONF imports
While reviewing config centralization patches I realized that we have a fair few files where we import cfg or setup CONF, but never actually use config variables. This patch cleans those up, but I am sure we'll add more as we move more flags around. Change-Id: I5851bbae2fa198a4e9be149a5836bea813848d89
This commit is contained in:
parent
dd03245bf1
commit
50a9550999
|
@ -14,7 +14,6 @@
|
||||||
|
|
||||||
"""The rescue mode extension."""
|
"""The rescue mode extension."""
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
import webob
|
import webob
|
||||||
from webob import exc
|
from webob import exc
|
||||||
|
|
||||||
|
@ -26,7 +25,6 @@ from nova import exception
|
||||||
from nova import utils
|
from nova import utils
|
||||||
|
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
authorize = exts.extension_authorizer('compute', 'rescue')
|
authorize = exts.extension_authorizer('compute', 'rescue')
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,14 +13,12 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import stevedore.driver
|
import stevedore.driver
|
||||||
import stevedore.extension
|
import stevedore.extension
|
||||||
|
|
||||||
from nova.i18n import _LE
|
from nova.i18n import _LE
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@ import sys
|
||||||
|
|
||||||
from neutronclient.common import exceptions as n_exc
|
from neutronclient.common import exceptions as n_exc
|
||||||
from neutronclient.neutron import v2_0 as neutronv20
|
from neutronclient.neutron import v2_0 as neutronv20
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_utils import excutils
|
from oslo_utils import excutils
|
||||||
from oslo_utils import uuidutils
|
from oslo_utils import uuidutils
|
||||||
|
@ -33,7 +32,6 @@ from nova import objects
|
||||||
from nova import utils
|
from nova import utils
|
||||||
|
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
# NOTE: Neutron client has a max URL length of 8192, so we have
|
# NOTE: Neutron client has a max URL length of 8192, so we have
|
||||||
|
|
|
@ -19,14 +19,10 @@
|
||||||
|
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
|
|
||||||
from nova import exception
|
from nova import exception
|
||||||
from nova.i18n import _
|
from nova.i18n import _
|
||||||
from nova import utils
|
from nova import utils
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
|
||||||
|
|
||||||
class SecurityGroupBase(object):
|
class SecurityGroupBase(object):
|
||||||
|
|
||||||
|
|
|
@ -13,15 +13,12 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from nova.i18n import _LW
|
from nova.i18n import _LW
|
||||||
from nova.scheduler import filters
|
from nova.scheduler import filters
|
||||||
from nova import servicegroup
|
from nova import servicegroup
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,6 @@ import os
|
||||||
|
|
||||||
from migrate.versioning import repository
|
from migrate.versioning import repository
|
||||||
import mock
|
import mock
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_db.sqlalchemy import test_base
|
from oslo_db.sqlalchemy import test_base
|
||||||
from oslo_db.sqlalchemy import test_migrations
|
from oslo_db.sqlalchemy import test_migrations
|
||||||
from oslo_db.sqlalchemy import utils as db_utils
|
from oslo_db.sqlalchemy import utils as db_utils
|
||||||
|
@ -47,9 +46,6 @@ from nova.db.sqlalchemy import migration as sa_migration
|
||||||
from nova import test
|
from nova import test
|
||||||
|
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
|
||||||
|
|
||||||
class NovaAPIModelsSync(test_migrations.ModelsMigrationsSync):
|
class NovaAPIModelsSync(test_migrations.ModelsMigrationsSync):
|
||||||
"""Test that the models match the database after migrations are run."""
|
"""Test that the models match the database after migrations are run."""
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
import fixtures
|
import fixtures
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from nova.tests.functional.api import client
|
from nova.tests.functional.api import client
|
||||||
|
@ -26,7 +25,6 @@ from nova.tests.unit.virt.libvirt import fake_libvirt_utils
|
||||||
from nova.tests.unit.virt.libvirt import fakelibvirt
|
from nova.tests.unit.virt.libvirt import fakelibvirt
|
||||||
|
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
from oslo_config import cfg
|
|
||||||
|
|
||||||
from nova.api.openstack.compute import attach_interfaces \
|
from nova.api.openstack.compute import attach_interfaces \
|
||||||
as attach_interfaces_v21
|
as attach_interfaces_v21
|
||||||
|
@ -31,8 +30,6 @@ from nova.tests.unit import fake_network_cache_model
|
||||||
from webob import exc
|
from webob import exc
|
||||||
|
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
|
||||||
FAKE_UUID1 = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
|
FAKE_UUID1 = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
|
||||||
FAKE_UUID2 = 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb'
|
FAKE_UUID2 = 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb'
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
import webob
|
import webob
|
||||||
|
|
||||||
from nova.api.openstack.compute import console_auth_tokens \
|
from nova.api.openstack.compute import console_auth_tokens \
|
||||||
|
@ -26,8 +25,6 @@ from nova.consoleauth import rpcapi as consoleauth_rpcapi
|
||||||
from nova import test
|
from nova import test
|
||||||
from nova.tests.unit.api.openstack import fakes
|
from nova.tests.unit.api.openstack import fakes
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
|
||||||
_FAKE_CONNECT_INFO = {'instance_uuid': 'fake_instance_uuid',
|
_FAKE_CONNECT_INFO = {'instance_uuid': 'fake_instance_uuid',
|
||||||
'host': 'fake_host',
|
'host': 'fake_host',
|
||||||
'port': 'fake_port',
|
'port': 'fake_port',
|
||||||
|
|
|
@ -13,15 +13,12 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
|
|
||||||
from nova.api.openstack import api_version_request as api_version
|
from nova.api.openstack import api_version_request as api_version
|
||||||
from nova import test
|
from nova import test
|
||||||
from nova.tests.unit.api.openstack import fakes
|
from nova.tests.unit.api.openstack import fakes
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
|
||||||
|
|
||||||
class MicroversionsTest(test.NoDBTestCase):
|
class MicroversionsTest(test.NoDBTestCase):
|
||||||
|
|
||||||
|
|
|
@ -13,14 +13,11 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
|
|
||||||
from nova import test
|
from nova import test
|
||||||
from nova.tests.unit.api.openstack import fakes
|
from nova.tests.unit.api.openstack import fakes
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
|
||||||
|
|
||||||
class PluginTest(test.NoDBTestCase):
|
class PluginTest(test.NoDBTestCase):
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
from oslo_config import cfg
|
|
||||||
import webob
|
import webob
|
||||||
|
|
||||||
from nova.api.openstack.compute.legacy_v2.contrib import \
|
from nova.api.openstack.compute.legacy_v2.contrib import \
|
||||||
|
@ -27,9 +26,6 @@ from nova import test
|
||||||
from nova.tests.unit.api.openstack import fakes
|
from nova.tests.unit.api.openstack import fakes
|
||||||
|
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
|
||||||
|
|
||||||
class AttrDict(dict):
|
class AttrDict(dict):
|
||||||
def __getattr__(self, k):
|
def __getattr__(self, k):
|
||||||
return self[k]
|
return self[k]
|
||||||
|
|
|
@ -20,9 +20,6 @@ import mock
|
||||||
from nova.console import websocketproxy
|
from nova.console import websocketproxy
|
||||||
from nova import exception
|
from nova import exception
|
||||||
from nova import test
|
from nova import test
|
||||||
from oslo_config import cfg
|
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
|
||||||
|
|
||||||
class NovaProxyRequestHandlerBaseTestCase(test.NoDBTestCase):
|
class NovaProxyRequestHandlerBaseTestCase(test.NoDBTestCase):
|
||||||
|
|
|
@ -18,7 +18,6 @@ Tests For Scheduler Utils
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
from oslo_config import cfg
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from nova.compute import flavors
|
from nova.compute import flavors
|
||||||
|
@ -32,8 +31,6 @@ from nova import test
|
||||||
from nova.tests.unit import fake_instance
|
from nova.tests.unit import fake_instance
|
||||||
from nova.tests.unit.objects import test_flavor
|
from nova.tests.unit.objects import test_flavor
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
|
||||||
|
|
||||||
class SchedulerUtilsTestCase(test.NoDBTestCase):
|
class SchedulerUtilsTestCase(test.NoDBTestCase):
|
||||||
"""Test case for scheduler utils methods."""
|
"""Test case for scheduler utils methods."""
|
||||||
|
|
|
@ -24,7 +24,6 @@ from oslo_context import fixture as o_fixture
|
||||||
from nova.compute import flavors
|
from nova.compute import flavors
|
||||||
from nova.compute import task_states
|
from nova.compute import task_states
|
||||||
from nova.compute import vm_states
|
from nova.compute import vm_states
|
||||||
import nova.conf
|
|
||||||
from nova import context
|
from nova import context
|
||||||
from nova import exception
|
from nova import exception
|
||||||
from nova import notifications
|
from nova import notifications
|
||||||
|
@ -34,8 +33,6 @@ from nova import test
|
||||||
from nova.tests.unit import fake_network
|
from nova.tests.unit import fake_network
|
||||||
from nova.tests.unit import fake_notifier
|
from nova.tests.unit import fake_notifier
|
||||||
|
|
||||||
CONF = nova.conf.CONF
|
|
||||||
|
|
||||||
|
|
||||||
class NotificationsTestCase(test.TestCase):
|
class NotificationsTestCase(test.TestCase):
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ import tempfile
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
from oslo_concurrency import processutils
|
from oslo_concurrency import processutils
|
||||||
from oslo_config import cfg
|
|
||||||
|
|
||||||
from nova import exception
|
from nova import exception
|
||||||
from nova import test
|
from nova import test
|
||||||
|
@ -26,7 +25,6 @@ from nova.virt.disk.mount import nbd
|
||||||
from nova.virt.disk.vfs import localfs as vfsimpl
|
from nova.virt.disk.vfs import localfs as vfsimpl
|
||||||
from nova.virt.image import model as imgmodel
|
from nova.virt.image import model as imgmodel
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
|
||||||
dirs = []
|
dirs = []
|
||||||
files = {}
|
files = {}
|
||||||
|
|
|
@ -16,13 +16,10 @@
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
from oslo_config import cfg
|
|
||||||
|
|
||||||
from nova import test
|
from nova import test
|
||||||
from nova.virt.vmwareapi import read_write_util
|
from nova.virt.vmwareapi import read_write_util
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
|
||||||
|
|
||||||
class ReadWriteUtilTestCase(test.NoDBTestCase):
|
class ReadWriteUtilTestCase(test.NoDBTestCase):
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_vmware import exceptions as vexc
|
from oslo_vmware import exceptions as vexc
|
||||||
from oslo_vmware import vim_util
|
from oslo_vmware import vim_util
|
||||||
|
|
||||||
|
@ -29,8 +28,6 @@ from nova.virt.vmwareapi import network_util
|
||||||
from nova.virt.vmwareapi import vif
|
from nova.virt.vmwareapi import vif
|
||||||
from nova.virt.vmwareapi import vm_util
|
from nova.virt.vmwareapi import vm_util
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
|
||||||
|
|
||||||
class VMwareVifTestCase(test.NoDBTestCase):
|
class VMwareVifTestCase(test.NoDBTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
|
|
@ -20,7 +20,6 @@ import os
|
||||||
|
|
||||||
from os_win import exceptions as os_win_exc
|
from os_win import exceptions as os_win_exc
|
||||||
from os_win import utilsfactory
|
from os_win import utilsfactory
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from nova.compute import task_states
|
from nova.compute import task_states
|
||||||
|
@ -30,7 +29,6 @@ from nova.image import glance
|
||||||
from nova import utils
|
from nova import utils
|
||||||
from nova.virt.hyperv import pathutils
|
from nova.virt.hyperv import pathutils
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue