From e28a34f560b83527f2f7022ded4bc91efa2059f8 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Sat, 27 Apr 2013 13:08:52 +0100 Subject: [PATCH] Send RPCs to 'engine' topic not 'engine.$host' Fixes bug #1173573 We currently send engine RPCs to the 'engine.$host' topic means that it is impossible to run heat-api and heat-engine on different machines because you can't configure heat-api with the hostname of heat-engine. Fix this simply by sending RPCs to 'engine' which heat-engine. We have always listened on this topic, so there is no backwards compat concerns. This is somewhat related to the multiple-engines blueprint, but doesn't really help or hinder it. Change-Id: Ibd4dc948ace4476bfa8e7fdc86e948a622416e58 --- heat/rpc/client.py | 3 +-- heat/tests/test_api_cfn_v1.py | 2 +- heat/tests/test_api_cloudwatch.py | 2 +- heat/tests/test_api_openstack_v1.py | 2 +- heat/tests/test_rpc_client.py | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/heat/rpc/client.py b/heat/rpc/client.py index 87ffd69a..e9dc26a4 100644 --- a/heat/rpc/client.py +++ b/heat/rpc/client.py @@ -20,7 +20,6 @@ Client side of the heat engine RPC API. from oslo.config import cfg -from heat.openstack.common import rpc import heat.openstack.common.rpc.proxy CONF = cfg.CONF @@ -38,7 +37,7 @@ class EngineClient(heat.openstack.common.rpc.proxy.RpcProxy): def __init__(self): super(EngineClient, self).__init__( - topic=rpc.queue_get_for(None, CONF.engine_topic, CONF.host), + topic=CONF.engine_topic, default_version=self.BASE_RPC_API_VERSION) def identify_stack(self, ctxt, stack_name): diff --git a/heat/tests/test_api_cfn_v1.py b/heat/tests/test_api_cfn_v1.py index 911f4167..e6a4f972 100644 --- a/heat/tests/test_api_cfn_v1.py +++ b/heat/tests/test_api_cfn_v1.py @@ -1408,7 +1408,7 @@ class CfnStackControllerTest(unittest.TestCase): cfg.CONF.register_opts(opts) cfg.CONF.set_default('engine_topic', 'engine') cfg.CONF.set_default('host', 'host') - self.topic = '%s.%s' % (cfg.CONF.engine_topic, cfg.CONF.host) + self.topic = cfg.CONF.engine_topic self.api_version = '1.0' # Create WSGI controller instance diff --git a/heat/tests/test_api_cloudwatch.py b/heat/tests/test_api_cloudwatch.py index e0f2669f..107a1822 100644 --- a/heat/tests/test_api_cloudwatch.py +++ b/heat/tests/test_api_cloudwatch.py @@ -522,7 +522,7 @@ class WatchControllerTest(unittest.TestCase): cfg.CONF.register_opts(opts) cfg.CONF.set_default('engine_topic', 'engine') cfg.CONF.set_default('host', 'host') - self.topic = '%s.%s' % (cfg.CONF.engine_topic, cfg.CONF.host) + self.topic = cfg.CONF.engine_topic self.api_version = '1.0' # Create WSGI controller instance diff --git a/heat/tests/test_api_openstack_v1.py b/heat/tests/test_api_openstack_v1.py index dc28d0ba..678f32d7 100644 --- a/heat/tests/test_api_openstack_v1.py +++ b/heat/tests/test_api_openstack_v1.py @@ -160,7 +160,7 @@ class ControllerTest(object): cfg.CONF.set_default('engine_topic', 'engine') cfg.CONF.set_default('host', 'host') - self.topic = '%s.%s' % (cfg.CONF.engine_topic, cfg.CONF.host) + self.topic = cfg.CONF.engine_topic self.api_version = '1.0' self.tenant = 't' diff --git a/heat/tests/test_rpc_client.py b/heat/tests/test_rpc_client.py index 11c5627f..ec8308a3 100644 --- a/heat/tests/test_rpc_client.py +++ b/heat/tests/test_rpc_client.py @@ -64,7 +64,7 @@ class EngineRpcAPITestCase(unittest.TestCase): expected_msg = rpcapi.make_msg(method, **kwargs) expected_msg['version'] = expected_version - expected_topic = '%s.%s' % (cfg.CONF.engine_topic, cfg.CONF.host) + expected_topic = cfg.CONF.engine_topic cast_and_call = ['delete_stack'] if rpc_method == 'call' and method in cast_and_call: -- 2.45.2