Config options: centralize options in conductor api
This change moves all of the configuration options previously defined in nova/conductor/api to the new centralized nova/conf directory. Blueprint centralize-config-options Change-Id: I8c420ac1de16d18613062112b2d86a5f66149dbf
This commit is contained in:
parent
908de5e029
commit
3bfcb1d2aa
|
@ -26,9 +26,9 @@ continue attempting to launch the rest of the services.
|
|||
|
||||
import sys
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
import nova.conf
|
||||
from nova import config
|
||||
from nova.i18n import _LE
|
||||
from nova import objects
|
||||
|
@ -37,9 +37,7 @@ from nova import utils
|
|||
from nova.vnc import xvp_proxy
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF.import_opt('manager', 'nova.conductor.api', group='conductor')
|
||||
CONF.import_opt('topic', 'nova.conductor.api', group='conductor')
|
||||
CONF = nova.conf.CONF
|
||||
CONF.import_opt('enabled_apis', 'nova.service')
|
||||
CONF.import_opt('enabled_ssl_apis', 'nova.service')
|
||||
|
||||
|
|
|
@ -18,11 +18,11 @@
|
|||
|
||||
import sys
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from oslo_reports import guru_meditation_report as gmr
|
||||
|
||||
from nova.conductor import rpcapi as conductor_rpcapi
|
||||
import nova.conf
|
||||
from nova import config
|
||||
from nova import objects
|
||||
from nova.objects import base as objects_base
|
||||
|
@ -31,9 +31,8 @@ from nova import utils
|
|||
from nova import version
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF = nova.conf.CONF
|
||||
CONF.import_opt('enabled_ssl_apis', 'nova.service')
|
||||
CONF.import_opt('use_local', 'nova.conductor.api', group='conductor')
|
||||
|
||||
|
||||
def main():
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
import sys
|
||||
import traceback
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from oslo_reports import guru_meditation_report as gmr
|
||||
|
||||
from nova.conductor import rpcapi as conductor_rpcapi
|
||||
import nova.conf
|
||||
from nova import config
|
||||
import nova.db.api
|
||||
from nova import exception
|
||||
|
@ -34,9 +34,8 @@ from nova import service
|
|||
from nova import utils
|
||||
from nova import version
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF = nova.conf.CONF
|
||||
CONF.import_opt('compute_topic', 'nova.compute.rpcapi')
|
||||
CONF.import_opt('use_local', 'nova.conductor.api', group='conductor')
|
||||
LOG = logging.getLogger('nova.compute')
|
||||
|
||||
|
||||
|
|
|
@ -17,18 +17,17 @@
|
|||
import sys
|
||||
|
||||
from oslo_concurrency import processutils
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from oslo_reports import guru_meditation_report as gmr
|
||||
|
||||
import nova.conf
|
||||
from nova import config
|
||||
from nova import objects
|
||||
from nova import service
|
||||
from nova import utils
|
||||
from nova import version
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF.import_opt('topic', 'nova.conductor.api', group='conductor')
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
def main():
|
||||
|
|
|
@ -30,6 +30,7 @@ from oslo_serialization import jsonutils
|
|||
from oslo_utils import importutils
|
||||
|
||||
from nova.conductor import rpcapi as conductor_rpcapi
|
||||
import nova.conf
|
||||
from nova import config
|
||||
from nova import context
|
||||
import nova.db.api
|
||||
|
@ -40,10 +41,9 @@ from nova import objects
|
|||
from nova.objects import base as objects_base
|
||||
from nova import rpc
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF = nova.conf.CONF
|
||||
CONF.import_opt('host', 'nova.netconf')
|
||||
CONF.import_opt('network_manager', 'nova.service')
|
||||
CONF.import_opt('use_local', 'nova.conductor.api', group='conductor')
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
import sys
|
||||
import traceback
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from oslo_reports import guru_meditation_report as gmr
|
||||
|
||||
from nova.conductor import rpcapi as conductor_rpcapi
|
||||
import nova.conf
|
||||
from nova import config
|
||||
import nova.db.api
|
||||
from nova import exception
|
||||
|
@ -34,9 +34,8 @@ from nova import service
|
|||
from nova import utils
|
||||
from nova import version
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF = nova.conf.CONF
|
||||
CONF.import_opt('network_topic', 'nova.network.rpcapi')
|
||||
CONF.import_opt('use_local', 'nova.conductor.api', group='conductor')
|
||||
LOG = logging.getLogger('nova.network')
|
||||
|
||||
|
||||
|
|
|
@ -12,14 +12,16 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import oslo_config.cfg
|
||||
|
||||
from nova.conductor import api as conductor_api
|
||||
import nova.conf
|
||||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
def API(*args, **kwargs):
|
||||
use_local = kwargs.pop('use_local', False)
|
||||
if oslo_config.cfg.CONF.conductor.use_local or use_local:
|
||||
if CONF.conductor.use_local or use_local:
|
||||
api = conductor_api.LocalAPI
|
||||
else:
|
||||
api = conductor_api.API
|
||||
|
@ -28,7 +30,7 @@ def API(*args, **kwargs):
|
|||
|
||||
def ComputeTaskAPI(*args, **kwargs):
|
||||
use_local = kwargs.pop('use_local', False)
|
||||
if oslo_config.cfg.CONF.conductor.use_local or use_local:
|
||||
if CONF.conductor.use_local or use_local:
|
||||
api = conductor_api.LocalComputeTaskAPI
|
||||
else:
|
||||
api = conductor_api.ComputeTaskAPI
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
"""Handles all requests to the conductor service."""
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
import oslo_messaging as messaging
|
||||
from oslo_versionedobjects import base as ovo_base
|
||||
|
@ -22,33 +21,11 @@ from oslo_versionedobjects import base as ovo_base
|
|||
from nova import baserpc
|
||||
from nova.conductor import manager
|
||||
from nova.conductor import rpcapi
|
||||
import nova.conf
|
||||
from nova.i18n import _LI, _LW
|
||||
from nova import utils
|
||||
|
||||
conductor_opts = [
|
||||
cfg.BoolOpt('use_local',
|
||||
default=False,
|
||||
help='DEPRECATED: Perform nova-conductor operations locally. '
|
||||
'This legacy mode was introduced to bridge a gap during '
|
||||
'the transition to the conductor service. It no longer '
|
||||
'represents a reasonable alternative for deployers. '
|
||||
'Removal may be as early as 14.0',
|
||||
deprecated_for_removal=True),
|
||||
cfg.StrOpt('topic',
|
||||
default='conductor',
|
||||
help='The topic on which conductor nodes listen'),
|
||||
cfg.StrOpt('manager',
|
||||
default='nova.conductor.manager.ConductorManager',
|
||||
help='Full class name for the Manager for conductor'),
|
||||
cfg.IntOpt('workers',
|
||||
help='Number of workers for OpenStack Conductor service. '
|
||||
'The default will be the number of CPUs available.')
|
||||
]
|
||||
conductor_group = cfg.OptGroup(name='conductor',
|
||||
title='Conductor Options')
|
||||
CONF = cfg.CONF
|
||||
CONF.register_group(conductor_group)
|
||||
CONF.register_opts(conductor_opts, conductor_group)
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -20,10 +20,11 @@ import oslo_messaging as messaging
|
|||
from oslo_serialization import jsonutils
|
||||
from oslo_versionedobjects import base as ovo_base
|
||||
|
||||
import nova.conf
|
||||
from nova.objects import base as objects_base
|
||||
from nova import rpc
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
rpcapi_cap_opt = cfg.StrOpt('conductor',
|
||||
help='Set a version cap for messages sent to conductor services')
|
||||
|
|
|
@ -30,7 +30,7 @@ from nova.conf import cert
|
|||
# from nova.conf import cinder
|
||||
# from nova.conf import cloudpipe
|
||||
from nova.conf import compute
|
||||
# from nova.conf import conductor
|
||||
from nova.conf import conductor
|
||||
# from nova.conf import configdrive
|
||||
# from nova.conf import console
|
||||
# from nova.conf import cors
|
||||
|
@ -90,7 +90,7 @@ cert.register_opts(CONF)
|
|||
# cinder.register_opts(CONF)
|
||||
# cloudpipe.register_opts(CONF)
|
||||
compute.register_opts(CONF)
|
||||
# conductor.register_opts(CONF)
|
||||
conductor.register_opts(CONF)
|
||||
# configdrive.register_opts(CONF)
|
||||
# console.register_opts(CONF)
|
||||
# cors.register_opts(CONF)
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
# Copyright (c) 2010 OpenStack Foundation
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# 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.
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
conductor_group = cfg.OptGroup(
|
||||
'conductor',
|
||||
title='Conductor Options')
|
||||
|
||||
use_local = cfg.BoolOpt(
|
||||
'use_local',
|
||||
default=False,
|
||||
help='DEPRECATED: Perform nova-conductor operations locally. '
|
||||
'This legacy mode was introduced to bridge a gap during '
|
||||
'the transition to the conductor service. It no longer '
|
||||
'represents a reasonable alternative for deployers. '
|
||||
'Removal may be as early as 14.0',
|
||||
deprecated_for_removal='True')
|
||||
|
||||
topic = cfg.StrOpt(
|
||||
'topic',
|
||||
default='conductor',
|
||||
help='The topic on which conductor nodes listen')
|
||||
|
||||
manager = cfg.StrOpt(
|
||||
'manager',
|
||||
default='nova.conductor.manager.ConductorManager',
|
||||
help='Full class name for the Manager for conductor')
|
||||
|
||||
workers = cfg.IntOpt(
|
||||
'workers',
|
||||
help='Number of workers for OpenStack Conductor service. '
|
||||
'The default will be the number of CPUs available.')
|
||||
|
||||
ALL_OPTS = [
|
||||
use_local,
|
||||
topic,
|
||||
manager,
|
||||
workers]
|
||||
|
||||
|
||||
def register_opts(conf):
|
||||
conf.register_group(conductor_group)
|
||||
conf.register_opts(ALL_OPTS, group=conductor_group)
|
||||
|
||||
|
||||
def list_opts():
|
||||
return {conductor_group: ALL_OPTS}
|
|
@ -19,7 +19,6 @@ import nova.cmd.novnc
|
|||
import nova.cmd.novncproxy
|
||||
import nova.cmd.serialproxy
|
||||
import nova.cmd.spicehtml5proxy
|
||||
import nova.conductor.api
|
||||
import nova.conductor.rpcapi
|
||||
import nova.conductor.tasks.live_migrate
|
||||
import nova.conf
|
||||
|
@ -96,7 +95,6 @@ def list_opts():
|
|||
('barbican', nova.keymgr.barbican.barbican_opts),
|
||||
('cinder', nova.volume.cinder.cinder_opts),
|
||||
('api_database', nova.db.sqlalchemy.api.api_db_opts),
|
||||
('conductor', nova.conductor.api.conductor_opts),
|
||||
('database', nova.db.sqlalchemy.api.oslo_db_options.database_opts),
|
||||
('glance', nova.image.glance.glance_opts),
|
||||
('image_file_url', [nova.image.download.file.opt_group]),
|
||||
|
|
Loading…
Reference in New Issue