Merge "remove unnecessary conf imports"
This commit is contained in:
commit
f81865f56b
@ -21,13 +21,10 @@ import webob.exc
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova.compute import rpcapi as compute_rpcapi
|
||||
import nova.conf
|
||||
from nova.i18n import _
|
||||
from nova.policies import instance_usage_audit_log as iual_policies
|
||||
from nova import utils
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
class InstanceUsageAuditLogController(wsgi.Controller):
|
||||
def __init__(self):
|
||||
|
@ -94,10 +94,6 @@ from nova.api.openstack.compute import virtual_interfaces
|
||||
from nova.api.openstack.compute import volumes
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.api import wsgi as base_wsgi
|
||||
import nova.conf
|
||||
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
def _create_controller(main_controller, controller_list,
|
||||
|
@ -17,13 +17,10 @@
|
||||
|
||||
|
||||
from nova.compute import rpcapi as compute_rpcapi
|
||||
import nova.conf
|
||||
from nova.console import rpcapi as console_rpcapi
|
||||
from nova.db import base
|
||||
from nova import objects
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
class API(base.Base):
|
||||
"""API for spinning up or down console proxy connections."""
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
import struct
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
import six
|
||||
|
||||
@ -27,8 +26,6 @@ from nova.i18n import _
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class RFBSecurityProxy(base.SecurityProxy):
|
||||
"""RFB Security Proxy Negotiation Helper.
|
||||
|
@ -19,7 +19,6 @@ from oslo_utils import strutils
|
||||
from oslo_utils import timeutils
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
import nova.conf
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
@ -27,7 +26,7 @@ from nova.objects import base
|
||||
from nova.objects import fields
|
||||
from nova import utils
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -16,13 +16,10 @@
|
||||
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
import nova.conf
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova.pci import devspec
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
class Whitelist(object):
|
||||
"""White list class to represent assignable pci devices.
|
||||
|
@ -15,15 +15,12 @@
|
||||
|
||||
from oslo_log import log as logging
|
||||
|
||||
import nova.conf
|
||||
from nova.i18n import _LW
|
||||
from nova.scheduler import filters
|
||||
from nova.scheduler.filters import utils
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
class DiskFilter(filters.BaseHostFilter):
|
||||
"""Disk Filter with over subscription flag."""
|
||||
|
@ -13,11 +13,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import nova.conf
|
||||
from nova.tests.functional.api_sample_tests import test_servers
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
class AdminPasswordJsonTest(test_servers.ServersSampleBase):
|
||||
sample_dir = 'os-admin-password'
|
||||
|
@ -17,13 +17,10 @@ import mock
|
||||
from six.moves import range
|
||||
|
||||
from nova.cells import state
|
||||
import nova.conf
|
||||
from nova.db.sqlalchemy import models
|
||||
from nova import exception
|
||||
from nova.tests.functional.api_sample_tests import api_sample_base
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
class CellsSampleJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
sample_dir = "os-cells"
|
||||
|
@ -13,12 +13,9 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import nova.conf
|
||||
from nova.tests.functional.api_sample_tests import api_sample_base
|
||||
from nova.tests.unit.image import fake
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
class ImagesSampleJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
sample_dir = 'images'
|
||||
|
@ -13,11 +13,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import nova.conf
|
||||
from nova.tests.functional.api_sample_tests import test_servers
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
class ServersMetadataJsonTest(test_servers.ServersSampleBase):
|
||||
sample_dir = 'server-metadata'
|
||||
|
@ -13,11 +13,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import nova.conf
|
||||
from nova.tests.functional.api_sample_tests import test_servers
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
class ServersIpsJsonTest(test_servers.ServersSampleBase):
|
||||
sample_dir = 'server-ips'
|
||||
|
@ -14,15 +14,12 @@
|
||||
|
||||
import datetime
|
||||
|
||||
import nova.conf
|
||||
from nova import test
|
||||
from nova.tests import fixtures as nova_fixtures
|
||||
from nova.tests.functional.api import client as api_client
|
||||
from nova.tests.unit.image import fake as fake_image
|
||||
from nova.tests.unit import policy_fixture
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
class TestServerGet(test.TestCase):
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
|
||||
from nova import context
|
||||
from nova import objects
|
||||
@ -22,9 +21,6 @@ from nova.tests.unit import fake_network
|
||||
from nova.tests.unit import fake_server_actions
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class ComputeManagerTestCase(test.TestCase):
|
||||
def setUp(self):
|
||||
super(ComputeManagerTestCase, self).setUp()
|
||||
|
@ -16,7 +16,6 @@ import datetime
|
||||
|
||||
import iso8601
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
|
||||
from nova.api.openstack.compute import availability_zone as az_v21
|
||||
from nova.api.openstack.compute import servers as servers_v21
|
||||
@ -34,7 +33,6 @@ from nova.tests.unit.objects import test_service
|
||||
from nova.tests import uuidsentinel
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
FAKE_UUID = fakes.FAKE_UUID
|
||||
|
||||
|
||||
|
@ -14,7 +14,6 @@
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_serialization import jsonutils
|
||||
from six.moves import range
|
||||
from webob import exc
|
||||
@ -29,8 +28,6 @@ from nova.tests.unit.api.openstack import fakes
|
||||
from nova.tests.unit.image import fake
|
||||
from nova.tests.unit import matchers
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class BlockDeviceMappingTestV21(test.TestCase):
|
||||
validation_error = exception.ValidationError
|
||||
|
@ -14,7 +14,6 @@
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_serialization import jsonutils
|
||||
from webob import exc
|
||||
|
||||
@ -28,8 +27,6 @@ from nova.tests.unit.api.openstack import fakes
|
||||
from nova.tests.unit.image import fake
|
||||
from nova.tests import uuidsentinel as uuids
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class BlockDeviceMappingTestV21(test.TestCase):
|
||||
validation_error = exception.ValidationError
|
||||
|
@ -14,7 +14,6 @@
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
from nova.api.openstack.compute import servers as servers_v21
|
||||
@ -26,8 +25,6 @@ from nova.tests.unit.api.openstack import fakes
|
||||
from nova.tests.unit.image import fake
|
||||
from nova.tests import uuidsentinel as uuids
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class ConfigDriveTestV21(test.TestCase):
|
||||
base_url = '/v2/fake/servers/'
|
||||
|
@ -13,7 +13,6 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
from nova.api.openstack import compute
|
||||
@ -24,9 +23,6 @@ from nova.tests.unit.api.openstack import fakes
|
||||
UUID = fakes.FAKE_UUID
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class SchedulerHintsTestCaseV21(test.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
|
@ -18,7 +18,6 @@ import datetime
|
||||
import uuid
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_serialization import base64
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
@ -33,7 +32,6 @@ from nova.tests.unit import fake_instance
|
||||
from nova.tests.unit.image import fake
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
FAKE_UUID = fakes.FAKE_UUID
|
||||
|
||||
|
||||
|
@ -29,7 +29,6 @@ from nova.cells import utils as cells_utils
|
||||
from nova.compute import instance_actions
|
||||
from nova.compute import task_states
|
||||
from nova.compute import vm_states
|
||||
import nova.conf
|
||||
from nova import context
|
||||
from nova import db
|
||||
from nova import exception
|
||||
@ -43,8 +42,6 @@ from nova.tests.unit import fake_instance
|
||||
from nova.tests.unit import fake_server_actions
|
||||
from nova.tests import uuidsentinel as uuids
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
class CellsMessageClassesTestCase(test.NoDBTestCase):
|
||||
"""Test case for the main Cells Message classes."""
|
||||
|
@ -20,15 +20,12 @@ import mock
|
||||
import six
|
||||
|
||||
from nova.cells import rpcapi as cells_rpcapi
|
||||
import nova.conf
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
from nova import test
|
||||
from nova.tests.unit import fake_instance
|
||||
from nova.tests import uuidsentinel as uuids
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
class CellsAPITestCase(test.NoDBTestCase):
|
||||
"""Test case for cells.api interfaces."""
|
||||
|
@ -24,7 +24,6 @@ from nova import block_device
|
||||
from nova.cells import filters
|
||||
from nova.cells import weights
|
||||
from nova.compute import vm_states
|
||||
import nova.conf
|
||||
from nova import context
|
||||
from nova import db
|
||||
from nova import exception
|
||||
@ -35,8 +34,6 @@ from nova.tests.unit import fake_block_device
|
||||
from nova.tests import uuidsentinel
|
||||
from nova import utils
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
class FakeFilterClass1(filters.BaseCellFilter):
|
||||
pass
|
||||
|
@ -30,7 +30,6 @@ from nova.compute import flavors
|
||||
from nova.compute import power_state
|
||||
from nova.compute import utils as compute_utils
|
||||
from nova.compute import vm_states
|
||||
import nova.conf
|
||||
from nova import context
|
||||
from nova import db
|
||||
from nova.db.sqlalchemy import api as db_api
|
||||
@ -48,7 +47,6 @@ from nova.tests import uuidsentinel as uuids
|
||||
|
||||
|
||||
ORIG_COMPUTE_API = None
|
||||
CONF = nova.conf.CONF
|
||||
FAKE_IMAGE_REF = uuids.image_ref
|
||||
|
||||
NODENAME = 'fakenode1'
|
||||
|
@ -28,7 +28,6 @@ from nova.compute import manager
|
||||
from nova.compute import power_state
|
||||
from nova.compute import task_states
|
||||
from nova.compute import utils as compute_utils
|
||||
import nova.conf
|
||||
from nova import context
|
||||
from nova import exception
|
||||
from nova.image import glance
|
||||
@ -45,13 +44,10 @@ from nova.tests.unit import fake_instance
|
||||
from nova.tests.unit import fake_network
|
||||
from nova.tests.unit import fake_notifier
|
||||
from nova.tests.unit import fake_server_actions
|
||||
import nova.tests.unit.image.fake
|
||||
from nova.tests.unit.objects import test_flavor
|
||||
from nova.tests import uuidsentinel as uuids
|
||||
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
FAKE_IMAGE_REF = uuids.image_ref
|
||||
|
||||
|
||||
|
@ -16,7 +16,6 @@ import mock
|
||||
|
||||
from nova.compute import manager
|
||||
from nova.compute import power_state
|
||||
import nova.conf
|
||||
from nova import context
|
||||
from nova import objects
|
||||
from nova.objects import instance as instance_obj
|
||||
@ -25,8 +24,6 @@ from nova.tests.unit import fake_instance
|
||||
from nova.tests.unit.virt.xenapi import stubs
|
||||
from nova.virt.xenapi import vm_utils
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
class ComputeXenTestCase(stubs.XenAPITestBaseNoDB):
|
||||
def setUp(self):
|
||||
|
@ -20,7 +20,6 @@ import mock
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
from nova.compute import rpcapi as compute_rpcapi
|
||||
import nova.conf
|
||||
from nova import context
|
||||
from nova import exception
|
||||
from nova.objects import block_device as objects_block_dev
|
||||
@ -32,8 +31,6 @@ from nova.tests.unit import fake_flavor
|
||||
from nova.tests.unit import fake_instance
|
||||
from nova.tests import uuidsentinel as uuids
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
class ComputeRpcAPITestCase(test.NoDBTestCase):
|
||||
|
||||
|
@ -17,15 +17,11 @@
|
||||
from oslo_config import fixture as config_fixture
|
||||
from oslo_policy import opts as policy_opts
|
||||
|
||||
import nova.conf
|
||||
from nova.conf import paths
|
||||
from nova import config
|
||||
from nova import ipv6
|
||||
import nova.keymgr
|
||||
from nova.tests.unit import utils
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
class ConfFixture(config_fixture.Config):
|
||||
"""Fixture to manage global conf settings."""
|
||||
|
@ -20,7 +20,6 @@ import fixtures
|
||||
import mock
|
||||
|
||||
from nova.compute import rpcapi as compute_rpcapi
|
||||
import nova.conf
|
||||
from nova.console import api as console_api
|
||||
from nova.console import manager as console_manager
|
||||
from nova import context
|
||||
@ -31,8 +30,6 @@ from nova import test
|
||||
from nova.tests.unit import fake_instance
|
||||
from nova.tests.unit import fake_xvp_console_proxy
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
class ConsoleTestCase(test.TestCase):
|
||||
"""Test case for console proxy manager."""
|
||||
|
@ -17,7 +17,6 @@ Unit Tests for nova.scheduler.rpcapi
|
||||
"""
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
|
||||
from nova import context
|
||||
from nova import exception as exc
|
||||
@ -26,8 +25,6 @@ from nova.scheduler import rpcapi as scheduler_rpcapi
|
||||
from nova import test
|
||||
from nova.tests import uuidsentinel as uuids
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class SchedulerRpcAPITestCase(test.NoDBTestCase):
|
||||
def _test_scheduler_api(self, method, rpc_method, expected_args=None,
|
||||
|
@ -20,7 +20,6 @@ Tests For Scheduler
|
||||
import mock
|
||||
import oslo_messaging as messaging
|
||||
|
||||
import nova.conf
|
||||
from nova import context
|
||||
from nova import objects
|
||||
from nova.scheduler import caching_scheduler
|
||||
@ -35,8 +34,6 @@ from nova.tests.unit import fake_server_actions
|
||||
from nova.tests.unit.scheduler import fakes
|
||||
from nova.tests import uuidsentinel as uuids
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
class SchedulerManagerInitTestCase(test.NoDBTestCase):
|
||||
"""Test case for scheduler manager initiation."""
|
||||
|
@ -20,12 +20,9 @@ Test the base rpc API.
|
||||
|
||||
from nova import baserpc
|
||||
from nova.compute import rpcapi as compute_rpcapi
|
||||
import nova.conf
|
||||
from nova import context
|
||||
from nova import test
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
class BaseAPITestCase(test.TestCase):
|
||||
|
||||
|
@ -22,7 +22,6 @@ from oslo_policy import policy as oslo_policy
|
||||
from oslo_serialization import jsonutils
|
||||
import requests_mock
|
||||
|
||||
import nova.conf
|
||||
from nova import context
|
||||
from nova import exception
|
||||
from nova import policy
|
||||
@ -31,8 +30,6 @@ from nova.tests.unit import fake_policy
|
||||
from nova.tests.unit import policy_fixture
|
||||
from nova import utils
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
class PolicyFileTestCase(test.NoDBTestCase):
|
||||
def setUp(self):
|
||||
|
@ -14,15 +14,11 @@ from keystoneauth1 import loading as ks_loading
|
||||
from keystoneauth1 import service_token
|
||||
import mock
|
||||
|
||||
import nova.conf
|
||||
from nova import context
|
||||
from nova import service_auth
|
||||
from nova import test
|
||||
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
class ServiceAuthTestCase(test.NoDBTestCase):
|
||||
|
||||
def setUp(self):
|
||||
|
@ -15,7 +15,6 @@
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from pypowervm import exceptions as pvm_ex
|
||||
from pypowervm.wrappers import network as pvm_net
|
||||
|
||||
@ -24,8 +23,6 @@ from nova.network import model
|
||||
from nova import test
|
||||
from nova.virt.powervm import vif
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
def cna(mac):
|
||||
"""Builds a mock Client Network Adapter for unit tests."""
|
||||
|
@ -18,18 +18,14 @@
|
||||
|
||||
from oslo_log import log as logging
|
||||
|
||||
|
||||
import nova.conf
|
||||
from nova import exception
|
||||
from nova import profiler
|
||||
from nova.virt import block_device as driver_block_device
|
||||
from nova.virt.libvirt import config as vconfig
|
||||
import nova.virt.libvirt.driver
|
||||
from nova.virt.libvirt import utils as libvirt_utils
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@profiler.trace_cls("volume_api")
|
||||
|
@ -25,14 +25,12 @@ import pypowervm.util as pvm_u
|
||||
import pypowervm.wrappers.cluster as pvm_clust
|
||||
import pypowervm.wrappers.storage as pvm_stg
|
||||
|
||||
import nova.conf
|
||||
from nova import exception
|
||||
from nova import image
|
||||
from nova.virt.powervm import vm
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
IMAGE_API = image.API()
|
||||
|
||||
|
@ -16,7 +16,6 @@
|
||||
|
||||
import abc
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import excutils
|
||||
@ -45,8 +44,6 @@ VIF_MAPPING = {VIF_TYPE_PVM_SEA:
|
||||
VIF_TYPE_PVM_OVS:
|
||||
'nova.virt.powervm.vif.PvmOvsVifDriver'}
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
def _build_vif_driver(adapter, instance, vif):
|
||||
"""Returns the appropriate VIF Driver for the given VIF.
|
||||
|
Loading…
x
Reference in New Issue
Block a user