From 580df542609eae01358d14f84bbeb278e8f86eac Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Tue, 8 Jan 2013 06:48:04 +0000 Subject: [PATCH] Move network_topic into nova.network.rpcapi The network_topic opt is only used in nova.network.rpcapi and it makes sense for the RPC module to "own" the topic option. blueprint: scope-config-opts Change-Id: Icd779f34df47ac6dd048b3e41995e872d8859872 --- bin/nova-network | 2 +- nova/config.py | 3 --- nova/network/rpcapi.py | 8 +++++++- nova/tests/network/test_rpcapi.py | 1 - 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/bin/nova-network b/bin/nova-network index 2a7ce1ffc660..03472371ca41 100755 --- a/bin/nova-network +++ b/bin/nova-network @@ -41,7 +41,7 @@ from nova import service from nova import utils CONF = cfg.CONF -CONF.import_opt('network_topic', 'nova.config') +CONF.import_opt('network_topic', 'nova.network.rpcapi') if __name__ == '__main__': config.parse_args(sys.argv) diff --git a/nova/config.py b/nova/config.py index d6f63d602760..fd3d0cc66846 100644 --- a/nova/config.py +++ b/nova/config.py @@ -56,9 +56,6 @@ global_opts = [ cfg.StrOpt('scheduler_topic', default='scheduler', help='the topic scheduler nodes listen on'), - cfg.StrOpt('network_topic', - default='network', - help='the topic network nodes listen on'), cfg.ListOpt('enabled_apis', default=['ec2', 'osapi_compute', 'metadata'], help='a list of APIs to enable by default'), diff --git a/nova/network/rpcapi.py b/nova/network/rpcapi.py index 4f8ebeb223ce..2f52add57ebb 100644 --- a/nova/network/rpcapi.py +++ b/nova/network/rpcapi.py @@ -23,8 +23,14 @@ from nova.openstack.common import jsonutils from nova.openstack.common import rpc from nova.openstack.common.rpc import proxy as rpc_proxy +rpcapi_opts = [ + cfg.StrOpt('network_topic', + default='network', + help='the topic network nodes listen on'), +] + CONF = cfg.CONF -CONF.import_opt('network_topic', 'nova.config') +CONF.register_opts(rpcapi_opts) class NetworkAPI(rpc_proxy.RpcProxy): diff --git a/nova/tests/network/test_rpcapi.py b/nova/tests/network/test_rpcapi.py index 032996209438..90bffeeafd32 100644 --- a/nova/tests/network/test_rpcapi.py +++ b/nova/tests/network/test_rpcapi.py @@ -25,7 +25,6 @@ from nova.openstack.common import rpc from nova import test CONF = cfg.CONF -CONF.import_opt('network_topic', 'nova.config') class NetworkRpcAPITestCase(test.TestCase):