diff options
author | Mark McLoughlin <markmc@redhat.com> | 2013-01-08 07:01:42 +0000 |
---|---|---|
committer | Mark McLoughlin <markmc@redhat.com> | 2013-01-09 08:13:14 +0000 |
commit | eac6e73223658595737ea001e1e0b18cfb4398c1 (patch) | |
tree | c0607447c8c036bb5fb32f08e9cc41e595c69745 | |
parent | 32cf601fc16d2de0a9e227bebebcbabc9fef5fb1 (diff) | |
download | nova-eac6e73223658595737ea001e1e0b18cfb4398c1.tar.gz |
Move compute_topic into nova.compute.rpcapi
Even though the compute_topic opt is used outside nova.compute.rpcapi,
it makes sense for the RPC module to "own" the topic option.
blueprint: scope-config-opts
Change-Id: I453951825481b9a5ba1865f6bf1223f7b1e25f98
-rwxr-xr-x | bin/nova-compute | 2 | ||||
-rw-r--r-- | nova/api/openstack/compute/contrib/instance_usage_audit_log.py | 2 | ||||
-rw-r--r-- | nova/compute/api.py | 2 | ||||
-rw-r--r-- | nova/compute/rpcapi.py | 8 | ||||
-rw-r--r-- | nova/config.py | 3 | ||||
-rw-r--r-- | nova/db/sqlalchemy/api.py | 2 | ||||
-rw-r--r-- | nova/scheduler/chance.py | 2 | ||||
-rw-r--r-- | nova/scheduler/driver.py | 2 | ||||
-rw-r--r-- | nova/tests/compute/test_compute.py | 1 | ||||
-rw-r--r-- | nova/tests/compute/test_rpcapi.py | 1 |
10 files changed, 13 insertions, 12 deletions
diff --git a/bin/nova-compute b/bin/nova-compute index bdc95dd348..d93ddb5bd3 100755 --- a/bin/nova-compute +++ b/bin/nova-compute @@ -48,7 +48,7 @@ from nova import service from nova import utils CONF = cfg.CONF -CONF.import_opt('compute_topic', 'nova.config') +CONF.import_opt('compute_topic', 'nova.compute.rpcapi') if __name__ == '__main__': config.parse_args(sys.argv) diff --git a/nova/api/openstack/compute/contrib/instance_usage_audit_log.py b/nova/api/openstack/compute/contrib/instance_usage_audit_log.py index bec9261abc..5d4db686c5 100644 --- a/nova/api/openstack/compute/contrib/instance_usage_audit_log.py +++ b/nova/api/openstack/compute/contrib/instance_usage_audit_log.py @@ -26,7 +26,7 @@ from nova.openstack.common import cfg from nova import utils CONF = cfg.CONF -CONF.import_opt('compute_topic', 'nova.config') +CONF.import_opt('compute_topic', 'nova.compute.rpcapi') authorize = extensions.extension_authorizer('compute', diff --git a/nova/compute/api.py b/nova/compute/api.py index 434fc05950..176b619958 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -89,7 +89,7 @@ compute_opts = [ CONF = cfg.CONF CONF.register_opts(compute_opts) -CONF.import_opt('compute_topic', 'nova.config') +CONF.import_opt('compute_topic', 'nova.compute.rpcapi') CONF.import_opt('consoleauth_topic', 'nova.consoleauth') MAX_USERDATA_SIZE = 65535 diff --git a/nova/compute/rpcapi.py b/nova/compute/rpcapi.py index 08adfefb72..463bfe9e9f 100644 --- a/nova/compute/rpcapi.py +++ b/nova/compute/rpcapi.py @@ -24,8 +24,14 @@ from nova.openstack.common import jsonutils from nova.openstack.common import rpc import nova.openstack.common.rpc.proxy +rpcapi_opts = [ + cfg.StrOpt('compute_topic', + default='compute', + help='the topic compute nodes listen on'), +] + CONF = cfg.CONF -CONF.import_opt('compute_topic', 'nova.config') +CONF.register_opts(rpcapi_opts) def _compute_topic(topic, ctxt, host, instance): diff --git a/nova/config.py b/nova/config.py index 450bf402a9..47e8b2486c 100644 --- a/nova/config.py +++ b/nova/config.py @@ -47,9 +47,6 @@ global_opts = [ cfg.StrOpt('my_ip', default=_get_my_ip(), help='ip address of this host'), - cfg.StrOpt('compute_topic', - default='compute', - help='the topic compute 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/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index f89ebfaa36..e7b9bfc754 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -49,7 +49,7 @@ from nova.openstack.common import uuidutils CONF = cfg.CONF -CONF.import_opt('compute_topic', 'nova.config') +CONF.import_opt('compute_topic', 'nova.compute.rpcapi') CONF.import_opt('sql_connection', 'nova.db.sqlalchemy.session') LOG = logging.getLogger(__name__) diff --git a/nova/scheduler/chance.py b/nova/scheduler/chance.py index bc5725acd4..98ef0fb207 100644 --- a/nova/scheduler/chance.py +++ b/nova/scheduler/chance.py @@ -28,7 +28,7 @@ from nova.openstack.common import cfg from nova.scheduler import driver CONF = cfg.CONF -CONF.import_opt('compute_topic', 'nova.config') +CONF.import_opt('compute_topic', 'nova.compute.rpcapi') class ChanceScheduler(driver.Scheduler): diff --git a/nova/scheduler/driver.py b/nova/scheduler/driver.py index c63b5643b8..d6ba794929 100644 --- a/nova/scheduler/driver.py +++ b/nova/scheduler/driver.py @@ -51,7 +51,7 @@ scheduler_driver_opts = [ CONF = cfg.CONF CONF.register_opts(scheduler_driver_opts) -CONF.import_opt('compute_topic', 'nova.config') +CONF.import_opt('compute_topic', 'nova.compute.rpcapi') CONF.import_opt('instances_path', 'nova.compute.manager') CONF.import_opt('libvirt_type', 'nova.virt.libvirt.driver') diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py index 9fa5619a3e..aa55891f17 100644 --- a/nova/tests/compute/test_compute.py +++ b/nova/tests/compute/test_compute.py @@ -71,7 +71,6 @@ QUOTAS = quota.QUOTAS LOG = logging.getLogger(__name__) CONF = cfg.CONF CONF.import_opt('compute_manager', 'nova.config') -CONF.import_opt('compute_topic', 'nova.config') CONF.import_opt('host', 'nova.config') CONF.import_opt('live_migration_retry_count', 'nova.compute.manager') diff --git a/nova/tests/compute/test_rpcapi.py b/nova/tests/compute/test_rpcapi.py index ca12cd0d25..b854c02884 100644 --- a/nova/tests/compute/test_rpcapi.py +++ b/nova/tests/compute/test_rpcapi.py @@ -27,7 +27,6 @@ from nova.openstack.common import rpc from nova import test CONF = cfg.CONF -CONF.import_opt('compute_topic', 'nova.config') class ComputeRpcAPITestCase(test.TestCase): |