Remove nova.config.CONF
Modules import nova.config for two reasons right now - firstly, to reference nova.config.CONF and, secondly, if they use one of the options defined in nova.config. Often modules import nova.openstack.common.cfg and nova.config which is a bit pointless since they could just use cfg.CONF if they just want to nova.config in order to reference CONF. Let's just use cfg.CONF everywhere and we can explicitly state where we actually require options defined in nova.config. Change-Id: Ie4184a74e3e78c99658becb18dce1c2087e450bb
This commit is contained in:
parent
5f28bdf1b2
commit
059b0302f9
@ -42,13 +42,14 @@ if os.path.exists(os.path.join(possible_topdir, "nova", "__init__.py")):
|
||||
|
||||
from nova import config
|
||||
from nova.objectstore import s3server
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import service
|
||||
from nova import utils
|
||||
from nova.vnc import xvp_proxy
|
||||
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
LOG = logging.getLogger('nova.all')
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -37,11 +37,12 @@ if os.path.exists(os.path.join(possible_topdir, "nova", "__init__.py")):
|
||||
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import service
|
||||
from nova import utils
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
|
||||
if __name__ == '__main__':
|
||||
config.parse_args(sys.argv)
|
||||
|
@ -33,11 +33,12 @@ if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'nova', '__init__.py')):
|
||||
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import service
|
||||
from nova import utils
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
|
||||
if __name__ == '__main__':
|
||||
config.parse_args(sys.argv)
|
||||
|
@ -52,7 +52,7 @@ delete_exchange_opt = cfg.BoolOpt('delete_exchange',
|
||||
default=False,
|
||||
help='delete nova exchange too.')
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_cli_opt(delete_exchange_opt)
|
||||
|
||||
|
||||
|
@ -42,11 +42,12 @@ if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'nova', '__init__.py')):
|
||||
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import service
|
||||
from nova import utils
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
|
||||
if __name__ == '__main__':
|
||||
config.parse_args(sys.argv)
|
||||
|
@ -33,11 +33,12 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
|
||||
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import service
|
||||
from nova import utils
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.import_opt('topic', 'nova.conductor.api', group='conductor')
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -34,10 +34,11 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
|
||||
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import service
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
|
||||
if __name__ == '__main__':
|
||||
config.parse_args(sys.argv)
|
||||
|
@ -33,10 +33,11 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
|
||||
|
||||
from nova import config
|
||||
from nova.consoleauth import manager
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import service
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
|
||||
if __name__ == "__main__":
|
||||
config.parse_args(sys.argv)
|
||||
|
@ -40,12 +40,13 @@ from nova import context
|
||||
from nova import db
|
||||
from nova.network import linux_net
|
||||
from nova.network import rpcapi as network_rpcapi
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import importutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import rpc
|
||||
from nova import utils
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
LOG = logging.getLogger('nova.dhcpbridge')
|
||||
|
||||
|
||||
|
@ -88,7 +88,7 @@ from nova.scheduler import rpcapi as scheduler_rpcapi
|
||||
from nova import utils
|
||||
from nova import version
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.import_opt('flat_network_bridge', 'nova.network.manager')
|
||||
CONF.import_opt('num_networks', 'nova.network.manager')
|
||||
CONF.import_opt('multi_host', 'nova.network.manager')
|
||||
|
@ -35,11 +35,12 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
|
||||
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import service
|
||||
from nova import utils
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
|
||||
if __name__ == '__main__':
|
||||
config.parse_args(sys.argv)
|
||||
|
@ -67,7 +67,7 @@ opts = [
|
||||
help='Port on which to listen for incoming requests'),
|
||||
]
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_cli_opts(opts)
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -34,12 +34,13 @@ if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'nova', '__init__.py')):
|
||||
|
||||
from nova import config
|
||||
from nova import exception
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import rpc
|
||||
from nova.openstack.common.rpc import impl_zmq
|
||||
from nova import utils
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opts(rpc.rpc_opts)
|
||||
CONF.register_opts(impl_zmq.zmq_opts)
|
||||
|
||||
|
@ -37,11 +37,12 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
|
||||
gettext.install('nova', unicode=1)
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import log as logging
|
||||
from nova import service
|
||||
from nova import utils
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
|
||||
if __name__ == '__main__':
|
||||
config.parse_args(sys.argv)
|
||||
|
@ -18,8 +18,9 @@
|
||||
import re
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
|
||||
DEFAULT_ROOT_DEV_NAME = '/dev/sda1'
|
||||
_DEFAULT_MAPPINGS = {'ami': 'sda1',
|
||||
|
@ -57,13 +57,14 @@ import eventlet
|
||||
|
||||
from nova import config
|
||||
from nova.db import base
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common.plugin import pluginmanager
|
||||
from nova.openstack.common.rpc import dispatcher as rpc_dispatcher
|
||||
from nova.scheduler import rpcapi as scheduler_rpcapi
|
||||
from nova import version
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -19,7 +19,6 @@
|
||||
the system.
|
||||
"""
|
||||
|
||||
from nova import config
|
||||
import nova.context
|
||||
from nova import db
|
||||
from nova import exception
|
||||
@ -50,7 +49,7 @@ notify_api_faults = cfg.BoolOpt('notify_api_faults', default=False,
|
||||
'in the API service.')
|
||||
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opt(notify_state_opt)
|
||||
CONF.register_opt(notify_any_opt)
|
||||
CONF.register_opt(notify_api_faults)
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
import os.path
|
||||
|
||||
from nova import config
|
||||
from nova import exception
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import policy
|
||||
@ -35,7 +34,7 @@ policy_opts = [
|
||||
help=_('Rule checked when requested rule is not found')),
|
||||
]
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opts(policy_opts)
|
||||
|
||||
_POLICY_PATH = None
|
||||
|
@ -20,7 +20,6 @@
|
||||
|
||||
import datetime
|
||||
|
||||
from nova import config
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova.openstack.common import cfg
|
||||
@ -79,7 +78,7 @@ quota_opts = [
|
||||
help='default driver to use for quota checks'),
|
||||
]
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opts(quota_opts)
|
||||
|
||||
|
||||
|
@ -25,9 +25,10 @@ import random
|
||||
|
||||
from nova import config
|
||||
from nova import exception
|
||||
from nova.openstack.common import cfg
|
||||
from nova.scheduler import driver
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class ChanceScheduler(driver.Scheduler):
|
||||
|
@ -52,10 +52,10 @@ scheduler_driver_opts = [
|
||||
help='Maximum number of attempts to schedule an instance'),
|
||||
]
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opts(scheduler_driver_opts)
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.import_opt('instances_path', 'nova.compute.manager')
|
||||
CONF.import_opt('libvirt_type', 'nova.virt.libvirt.driver')
|
||||
|
||||
|
@ -19,14 +19,14 @@ You can customize this scheduler by specifying your own Host Filters and
|
||||
Weighing Functions.
|
||||
"""
|
||||
|
||||
from nova import config
|
||||
from nova import exception
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common.notifier import api as notifier
|
||||
from nova.scheduler import driver
|
||||
from nova.scheduler import scheduler_options
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -13,12 +13,12 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.scheduler import filters
|
||||
from nova import utils
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -15,7 +15,6 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.scheduler import filters
|
||||
@ -27,7 +26,7 @@ cpu_allocation_ratio_opt = cfg.FloatOpt('cpu_allocation_ratio',
|
||||
default=16.0,
|
||||
help='Virtual CPU to Physical CPU allocation ratio')
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opt(cpu_allocation_ratio_opt)
|
||||
|
||||
|
||||
|
@ -13,7 +13,6 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.scheduler import filters
|
||||
@ -23,7 +22,7 @@ LOG = logging.getLogger(__name__)
|
||||
disk_allocation_ratio_opt = cfg.FloatOpt("disk_allocation_ratio", default=1.0,
|
||||
help="virtual disk to physical disk allocation ratio")
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opt(disk_allocation_ratio_opt)
|
||||
|
||||
|
||||
|
@ -13,7 +13,6 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.scheduler import filters
|
||||
@ -24,7 +23,7 @@ max_io_ops_per_host_opt = cfg.IntOpt("max_io_ops_per_host",
|
||||
default=8,
|
||||
help="Ignore hosts that have too many builds/resizes/snaps/migrations")
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opt(max_io_ops_per_host_opt)
|
||||
|
||||
|
||||
|
@ -14,9 +14,10 @@
|
||||
# under the License.
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
from nova.scheduler import filters
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class IsolatedHostsFilter(filters.BaseHostFilter):
|
||||
|
@ -13,7 +13,6 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.scheduler import filters
|
||||
@ -24,7 +23,7 @@ max_instances_per_host_opt = cfg.IntOpt("max_instances_per_host",
|
||||
default=50,
|
||||
help="Ignore hosts that have too many instances")
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opt(max_instances_per_host_opt)
|
||||
|
||||
|
||||
|
@ -14,7 +14,6 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.scheduler import filters
|
||||
@ -25,7 +24,7 @@ ram_allocation_ratio_opt = cfg.FloatOpt("ram_allocation_ratio",
|
||||
default=1.5,
|
||||
help="virtual ram to physical ram allocation ratio")
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opt(ram_allocation_ratio_opt)
|
||||
|
||||
|
||||
|
@ -48,7 +48,6 @@ import httplib
|
||||
import socket
|
||||
import ssl
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
@ -81,7 +80,7 @@ trusted_opts = [
|
||||
help='attestation authorization blob - must change'),
|
||||
]
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
trust_group = cfg.OptGroup(name='trusted_computing', title='Trust parameters')
|
||||
CONF.register_group(trust_group)
|
||||
CONF.register_opts(trusted_opts, group=trust_group)
|
||||
|
@ -21,7 +21,6 @@ import UserDict
|
||||
|
||||
from nova.compute import task_states
|
||||
from nova.compute import vm_states
|
||||
from nova import config
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova.openstack.common import cfg
|
||||
@ -53,7 +52,7 @@ host_manager_opts = [
|
||||
help='Which weight class names to use for weighing hosts'),
|
||||
]
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opts(host_manager_opts)
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -26,7 +26,6 @@ import sys
|
||||
from nova.compute import rpcapi as compute_rpcapi
|
||||
from nova.compute import utils as compute_utils
|
||||
from nova.compute import vm_states
|
||||
from nova import config
|
||||
import nova.context
|
||||
from nova import db
|
||||
from nova import exception
|
||||
@ -46,7 +45,7 @@ scheduler_driver_opt = cfg.StrOpt('scheduler_driver',
|
||||
default='nova.scheduler.filter_scheduler.FilterScheduler',
|
||||
help='Default driver to use for the scheduler')
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opt(scheduler_driver_opt)
|
||||
|
||||
QUOTAS = quota.QUOTAS
|
||||
|
@ -27,7 +27,6 @@ schedule requests to compute nodes but provide their own manager and topic.
|
||||
https://bugs.launchpad.net/nova/+bug/1009681
|
||||
"""
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import importutils
|
||||
from nova.scheduler import driver
|
||||
@ -43,7 +42,7 @@ multi_scheduler_opts = [
|
||||
help='Default driver to use for scheduling calls'),
|
||||
]
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opts(multi_scheduler_opts)
|
||||
|
||||
|
||||
|
@ -19,10 +19,11 @@ Client side of the scheduler manager RPC API.
|
||||
"""
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import jsonutils
|
||||
import nova.openstack.common.rpc.proxy
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class SchedulerAPI(nova.openstack.common.rpc.proxy.RpcProxy):
|
||||
|
@ -26,7 +26,6 @@ import datetime
|
||||
import json
|
||||
import os
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import timeutils
|
||||
@ -37,7 +36,7 @@ scheduler_json_config_location_opt = cfg.StrOpt(
|
||||
default='',
|
||||
help='Absolute path to scheduler configuration JSON file.')
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opt(scheduler_json_config_location_opt)
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -18,13 +18,13 @@ Scheduler host weights
|
||||
"""
|
||||
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.scheduler.weights import least_cost
|
||||
from nova import weights
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class WeighedHost(weights.WeighedObject):
|
||||
|
@ -25,7 +25,6 @@ NOTE(comstud): This is deprecated. One should use the RAMWeigher and/or
|
||||
create other weight modules.
|
||||
"""
|
||||
|
||||
from nova import config
|
||||
from nova import exception
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import importutils
|
||||
@ -48,7 +47,7 @@ least_cost_opts = [
|
||||
'e.g. spread-first'),
|
||||
]
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opts(least_cost_opts)
|
||||
|
||||
|
||||
|
@ -20,7 +20,6 @@ stacking, you can set the 'ram_weight_multiplier' option to a negative
|
||||
number and the weighing has the opposite effect of the default.
|
||||
"""
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
from nova.scheduler import weights
|
||||
|
||||
@ -32,7 +31,7 @@ ram_weight_opts = [
|
||||
'numbers mean to stack vs spread.'),
|
||||
]
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opts(ram_weight_opts)
|
||||
|
||||
|
||||
|
@ -90,7 +90,7 @@ service_opts = [
|
||||
help='Number of workers for metadata service'),
|
||||
]
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opts(service_opts)
|
||||
|
||||
|
||||
|
@ -49,7 +49,7 @@ test_opts = [
|
||||
help='should we use everything for testing'),
|
||||
]
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opts(test_opts)
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -33,6 +33,7 @@ import shutil
|
||||
|
||||
from nova import config
|
||||
from nova.db.sqlalchemy.session import get_engine
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
import eventlet
|
||||
@ -40,7 +41,7 @@ import eventlet
|
||||
|
||||
eventlet.monkey_patch(os=False)
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.set_override('use_stderr', False)
|
||||
|
||||
logging.setup('nova')
|
||||
|
@ -15,15 +15,15 @@
|
||||
|
||||
"""Bare-metal DB test base class."""
|
||||
|
||||
from nova import config
|
||||
from nova import context as nova_context
|
||||
from nova.openstack.common import cfg
|
||||
from nova import test
|
||||
from nova.virt.baremetal.db import migration as bm_migration
|
||||
from nova.virt.baremetal.db.sqlalchemy import session as bm_session
|
||||
|
||||
_DB = None
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.import_opt('baremetal_sql_connection',
|
||||
'nova.virt.baremetal.db.sqlalchemy.session')
|
||||
|
||||
|
@ -16,8 +16,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opt(cfg.IntOpt('answer', default=42, help='test flag'))
|
||||
|
@ -17,8 +17,9 @@
|
||||
# under the License.
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
|
||||
CONF.import_opt('scheduler_driver', 'nova.scheduler.manager')
|
||||
CONF.import_opt('fake_network', 'nova.network.manager')
|
||||
|
@ -16,8 +16,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opt(cfg.IntOpt('runtime_answer', default=54, help='test flag'))
|
||||
|
@ -22,6 +22,7 @@ from nova import config
|
||||
from nova import context
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.scheduler import filters
|
||||
from nova.scheduler.filters import extra_specs_ops
|
||||
@ -30,7 +31,7 @@ from nova import test
|
||||
from nova.tests.scheduler import fakes
|
||||
from nova import utils
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
DATA = ''
|
||||
|
||||
|
||||
|
@ -15,7 +15,6 @@
|
||||
"""
|
||||
Tests For Least Cost functions.
|
||||
"""
|
||||
from nova import config
|
||||
from nova import context
|
||||
from nova.openstack.common import cfg
|
||||
from nova.scheduler import weights
|
||||
@ -33,7 +32,7 @@ test_least_cost_opts = [
|
||||
help='How much weight to give the fake_weigher2 function'),
|
||||
]
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.import_opt('least_cost_functions', 'nova.scheduler.weights.least_cost')
|
||||
CONF.import_opt('compute_fill_first_cost_fn_weight',
|
||||
'nova.scheduler.weights.least_cost')
|
||||
|
@ -20,11 +20,12 @@ Unit Tests for nova.scheduler.rpcapi
|
||||
|
||||
from nova import config
|
||||
from nova import context
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import rpc
|
||||
from nova.scheduler import rpcapi as scheduler_rpcapi
|
||||
from nova import test
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class SchedulerRpcAPITestCase(test.TestCase):
|
||||
|
@ -26,7 +26,6 @@ from nova.compute import power_state
|
||||
from nova.compute import rpcapi as compute_rpcapi
|
||||
from nova.compute import utils as compute_utils
|
||||
from nova.compute import vm_states
|
||||
from nova import config
|
||||
from nova import context
|
||||
from nova import db
|
||||
from nova import exception
|
||||
|
@ -36,7 +36,6 @@ from nova.api import ec2
|
||||
from nova.api.ec2 import apirequest
|
||||
from nova.api.ec2 import ec2utils
|
||||
from nova import block_device
|
||||
from nova import config
|
||||
from nova import context
|
||||
from nova import exception
|
||||
from nova.openstack.common import timeutils
|
||||
|
@ -22,16 +22,16 @@
|
||||
import datetime
|
||||
import uuid as stdlib_uuid
|
||||
|
||||
from nova import config
|
||||
from nova import context
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import timeutils
|
||||
from nova import test
|
||||
from nova.tests import matchers
|
||||
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.import_opt('reserved_host_memory_mb', 'nova.compute.resource_tracker')
|
||||
CONF.import_opt('reserved_host_disk_mb', 'nova.compute.resource_tracker')
|
||||
|
||||
|
@ -21,7 +21,7 @@ from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
from nova import test
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opt(cfg.StrOpt('flags_unittest',
|
||||
default='foo',
|
||||
help='for testing purposes only'))
|
||||
|
@ -26,10 +26,10 @@ import sys
|
||||
import uuid
|
||||
|
||||
from nova.compute import power_state
|
||||
from nova import config
|
||||
from nova import context
|
||||
from nova import db
|
||||
from nova.image import glance
|
||||
from nova.openstack.common import cfg
|
||||
from nova.tests import fake_network
|
||||
from nova.tests.hyperv import basetestcase
|
||||
from nova.tests.hyperv import db_fakes
|
||||
@ -41,7 +41,7 @@ from nova.virt.hyperv import driver as driver_hyperv
|
||||
from nova.virt.hyperv import vmutils
|
||||
from nova.virt import images
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class HyperVAPITestCase(basetestcase.BaseTestCase):
|
||||
|
@ -17,13 +17,13 @@
|
||||
|
||||
import os
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import fileutils
|
||||
from nova import test
|
||||
from nova.tests import fake_libvirt_utils
|
||||
from nova.virt.libvirt import imagebackend
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class _ImageTestCase(test.TestCase):
|
||||
|
@ -29,13 +29,14 @@ from nova.compute import manager as compute_manager
|
||||
from nova.compute import vm_states
|
||||
from nova import config
|
||||
from nova import db
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import importutils
|
||||
from nova.openstack.common import log
|
||||
from nova import utils
|
||||
from nova.virt.libvirt import imagecache
|
||||
from nova.virt.libvirt import utils as virtutils
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
@ -18,7 +18,6 @@ Unit Tests for instance types code
|
||||
import time
|
||||
|
||||
from nova.compute import instance_types
|
||||
from nova import config
|
||||
from nova import context
|
||||
from nova import db
|
||||
from nova.db.sqlalchemy import models
|
||||
|
@ -37,6 +37,7 @@ from nova import config
|
||||
from nova import context
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import fileutils
|
||||
from nova.openstack.common import importutils
|
||||
from nova.openstack.common import jsonutils
|
||||
@ -69,7 +70,7 @@ except ImportError:
|
||||
libvirt_driver.libvirt = libvirt
|
||||
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
_fake_network_info = fake_network.fake_get_instance_nw_info
|
||||
|
@ -16,13 +16,13 @@
|
||||
|
||||
from lxml import etree
|
||||
|
||||
from nova import config
|
||||
from nova.openstack.common import cfg
|
||||
from nova import test
|
||||
from nova import utils
|
||||
from nova.virt.libvirt import config as vconfig
|
||||
from nova.virt.libvirt import vif
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class LibvirtVifTestCase(test.TestCase):
|
||||
|
@ -18,7 +18,6 @@
|
||||
Test suite for PowerVMDriver.
|
||||
"""
|
||||
|
||||
from nova import config
|
||||
from nova import context
|
||||
from nova import db
|
||||
from nova import test
|
||||
|
@ -17,7 +17,6 @@
|
||||
|
||||
import os
|
||||
|
||||
from nova import config
|
||||
from nova import exception
|
||||
from nova import test
|
||||
from nova import tests
|
||||
|
@ -20,7 +20,6 @@ Test suite for VMWareAPI.
|
||||
"""
|
||||
|
||||
from nova.compute import power_state
|
||||
from nova import config
|
||||
from nova import context
|
||||
from nova import db
|
||||
from nova import exception
|
||||
|
@ -33,6 +33,7 @@ from nova import config
|
||||
from nova import context
|
||||
from nova import db
|
||||
from nova import exception
|
||||
from nova.openstack.common import cfg
|
||||
from nova.openstack.common import importutils
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
@ -56,7 +57,7 @@ from nova.virt.xenapi import volume_utils
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
|
||||
IMAGE_MACHINE = '1'
|
||||
IMAGE_KERNEL = '2'
|
||||
|
@ -56,7 +56,7 @@ from nova.openstack.common import timeutils
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opt(
|
||||
cfg.BoolOpt('disable_process_locking', default=False,
|
||||
help='Whether to disable inter-process locks'))
|
||||
|
@ -44,7 +44,7 @@ wsgi_opts = [
|
||||
'into it: client_ip, date_time, request_line, status_code, '
|
||||
'body_length, wall_seconds.')
|
||||
]
|
||||
CONF = config.CONF
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opts(wsgi_opts)
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
Loading…
Reference in New Issue
Block a user