From b4af87863485b1dd074ba9f639f5cf5c78fa8fa1 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Tue, 8 Jan 2013 06:58:02 +0000 Subject: Move scheduler_topic into nova.scheduler.rpcapi The scheduler_topic opt is only used in nova.scheduler.rpcapi and it makes sense for the RPC module to "own" the topic option. blueprint: scope-config-opts Change-Id: Iafb8705eb716b650b63e060fe1dd36666bcee812 --- bin/nova-scheduler | 2 +- nova/config.py | 3 --- nova/scheduler/rpcapi.py | 8 +++++++- nova/tests/api/openstack/compute/test_servers.py | 2 +- nova/tests/scheduler/test_rpcapi.py | 1 - nova/tests/test_quota.py | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/bin/nova-scheduler b/bin/nova-scheduler index e157eef6b..507ff3d5a 100755 --- a/bin/nova-scheduler +++ b/bin/nova-scheduler @@ -43,7 +43,7 @@ from nova import service from nova import utils CONF = cfg.CONF -CONF.import_opt('scheduler_topic', 'nova.config') +CONF.import_opt('scheduler_topic', 'nova.scheduler.rpcapi') if __name__ == '__main__': config.parse_args(sys.argv) diff --git a/nova/config.py b/nova/config.py index bbea5ef83..e4c4fb513 100644 --- a/nova/config.py +++ b/nova/config.py @@ -50,9 +50,6 @@ global_opts = [ cfg.StrOpt('compute_topic', default='compute', help='the topic compute nodes listen on'), - cfg.StrOpt('scheduler_topic', - default='scheduler', - help='the topic scheduler 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/scheduler/rpcapi.py b/nova/scheduler/rpcapi.py index 6ae4adcae..c3a37d6ad 100644 --- a/nova/scheduler/rpcapi.py +++ b/nova/scheduler/rpcapi.py @@ -22,8 +22,14 @@ from nova.openstack.common import cfg from nova.openstack.common import jsonutils import nova.openstack.common.rpc.proxy +rpcapi_opts = [ + cfg.StrOpt('scheduler_topic', + default='scheduler', + help='the topic scheduler nodes listen on'), +] + CONF = cfg.CONF -CONF.import_opt('scheduler_topic', 'nova.config') +CONF.register_opts(rpcapi_opts) class SchedulerAPI(nova.openstack.common.rpc.proxy.RpcProxy): diff --git a/nova/tests/api/openstack/compute/test_servers.py b/nova/tests/api/openstack/compute/test_servers.py index f916925fd..62eba8cd6 100644 --- a/nova/tests/api/openstack/compute/test_servers.py +++ b/nova/tests/api/openstack/compute/test_servers.py @@ -55,7 +55,7 @@ from nova.tests import matchers CONF = cfg.CONF CONF.import_opt('password_length', 'nova.utils') -CONF.import_opt('scheduler_topic', 'nova.config') +CONF.import_opt('scheduler_topic', 'nova.scheduler.rpcapi') FAKE_UUID = fakes.FAKE_UUID NS = "{http://docs.openstack.org/compute/api/v1.1}" diff --git a/nova/tests/scheduler/test_rpcapi.py b/nova/tests/scheduler/test_rpcapi.py index da7652a50..e9a1680a8 100644 --- a/nova/tests/scheduler/test_rpcapi.py +++ b/nova/tests/scheduler/test_rpcapi.py @@ -25,7 +25,6 @@ from nova.scheduler import rpcapi as scheduler_rpcapi from nova import test CONF = cfg.CONF -CONF.import_opt('scheduler_topic', 'nova.config') class SchedulerRpcAPITestCase(test.TestCase): diff --git a/nova/tests/test_quota.py b/nova/tests/test_quota.py index 28e9ccfda..2eec1574a 100644 --- a/nova/tests/test_quota.py +++ b/nova/tests/test_quota.py @@ -34,7 +34,7 @@ from nova import test import nova.tests.image.fake CONF = cfg.CONF -CONF.import_opt('scheduler_topic', 'nova.config') +CONF.import_opt('scheduler_topic', 'nova.scheduler.rpcapi') CONF.import_opt('compute_driver', 'nova.virt.driver') -- cgit