]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Send RPCs to 'engine' topic not 'engine.$host'
authorMark McLoughlin <markmc@redhat.com>
Sat, 27 Apr 2013 12:08:52 +0000 (13:08 +0100)
committerMark McLoughlin <markmc@redhat.com>
Sat, 27 Apr 2013 12:25:34 +0000 (13:25 +0100)
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
heat/tests/test_api_cfn_v1.py
heat/tests/test_api_cloudwatch.py
heat/tests/test_api_openstack_v1.py
heat/tests/test_rpc_client.py

index 87ffd69a07069c99b2c626e5991325857f31c37a..e9dc26a4b97265faacf5ec6e48fc80e5a43d90dd 100644 (file)
@@ -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):
index 911f4167451f16f59c207ddec1f1a968ca965409..e6a4f9724f68da5cf8b7ac9d7cf2830b96e67545 100644 (file)
@@ -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
index e0f2669fff842969951230a6a3ecfd29bd9cb41e..107a182264b56ec3f1a256696e5bd97f82f4c8cb 100644 (file)
@@ -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
index dc28d0bacad700b643f465cb552af52485afe130..678f32d7f7538c73df6320674cc9157e2bb976cc 100644 (file)
@@ -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'
 
index 11c5627f343cf311961c058d7cae51eb2ca8c7ea..ec8308a35c629c90851093c88c22c8b116959d6c 100644 (file)
@@ -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: