centralized conf: nova/network/rpcapi.py

Moving the config options, used in nova/network/rpcapi.py
for nova network, to the new central location
"nova/conf/network.py".

Implements: blueprint centralize-config-options-newton

Change-Id: I62f019632e72359711430ad2f017911337f2e30b
This commit is contained in:
Toan Nguyen 2016-01-25 10:21:49 -05:00 committed by John Garbutt
parent 9cc414a29a
commit 32b510aaa0
4 changed files with 12 additions and 39 deletions

View File

@ -670,8 +670,18 @@ driver_opts = [
help='Driver to use for network creation'),
]
rpcapi_opts = [
cfg.StrOpt('network_topic',
default='network',
help='The topic network nodes listen on'),
cfg.BoolOpt('multi_host',
default=False,
help='Default value for multi_host in networks. Also, if set, '
'some rpc network calls will be sent directly to host.'),
]
ALL_DEFAULT_OPTS = (linux_net_opts + network_opts + ldap_dns_opts
+ security_group_opts + driver_opts)
+ security_group_opts + rpcapi_opts + driver_opts)
def register_opts(conf):
@ -680,6 +690,7 @@ def register_opts(conf):
conf.register_opts(ldap_dns_opts)
conf.register_opts(security_group_opts)
conf.register_opts(driver_opts)
conf.register_opts(rpcapi_opts)
def list_opts():

View File

@ -1,26 +0,0 @@
# 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.
import itertools
import nova.network
import nova.network.floating_ips
import nova.network.rpcapi
def list_opts():
return [
('DEFAULT',
itertools.chain(
nova.network.rpcapi.rpcapi_opts,
))
]

View File

@ -16,7 +16,6 @@
Client side of the network RPC API.
"""
from oslo_config import cfg
import oslo_messaging as messaging
from oslo_serialization import jsonutils
@ -24,18 +23,8 @@ import nova.conf
from nova.objects import base as objects_base
from nova import rpc
rpcapi_opts = [
cfg.StrOpt('network_topic',
default='network',
help='The topic network nodes listen on'),
cfg.BoolOpt('multi_host',
default=False,
help='Default value for multi_host in networks. Also, if set, '
'some rpc network calls will be sent directly to host.'),
]
CONF = nova.conf.CONF
CONF.register_opts(rpcapi_opts)
class NetworkAPI(object):

View File

@ -31,7 +31,6 @@ oslo.config.opts =
nova.api = nova.api.opts:list_opts
nova.cells = nova.cells.opts:list_opts
nova.compute = nova.compute.opts:list_opts
nova.network = nova.network.opts:list_opts
nova.network.neutronv2 = nova.network.neutronv2.api:list_opts
nova.virt = nova.virt.opts:list_opts
nova.cache_utils = nova.cache_utils:list_opts