From f19c54dd9a906a538b527268b6746daa162da5ad Mon Sep 17 00:00:00 2001 From: Angus Salkeld Date: Mon, 23 Mar 2015 09:23:28 +1000 Subject: [PATCH] Fix the topic and server that the listener client uses This was only working for one heat engine as it was sending the listener messages to a topic of "engine_id". Change-Id: Ib542d1ebb85b004f5a67213e678882c5a723dc0e Closes-bug: 1433821 --- heat/engine/service.py | 5 +++-- heat/engine/stack_lock.py | 4 ++-- heat/rpc/api.py | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/heat/engine/service.py b/heat/engine/service.py index 41a07d3b2e..2fe205342f 100644 --- a/heat/engine/service.py +++ b/heat/engine/service.py @@ -232,7 +232,7 @@ class EngineListener(service.Service): super(EngineListener, self).start() self.target = messaging.Target( server=self.engine_id, - topic="heat-engine-listener") + topic=rpc_api.LISTENER_TOPIC) server = rpc_messaging.get_rpc_server(self.target, self) server.start() @@ -863,7 +863,8 @@ class EngineService(service.Service): self.cctxt = self._client.prepare( version='1.0', timeout=timeout, - topic=lock_engine_id) + topic=rpc_api.LISTENER_TOPIC, + server=lock_engine_id) try: self.cctxt.call(cnxt, call, *args, **kwargs) except messaging.MessagingTimeout: diff --git a/heat/engine/stack_lock.py b/heat/engine/stack_lock.py index 5633e4fc54..638b36a091 100644 --- a/heat/engine/stack_lock.py +++ b/heat/engine/stack_lock.py @@ -24,7 +24,7 @@ from heat.common.i18n import _LI from heat.common.i18n import _LW from heat.common import messaging as rpc_messaging from heat.objects import stack_lock as stack_lock_object - +from heat.rpc import api as rpc_api cfg.CONF.import_opt('engine_life_check_timeout', 'heat.common.config') @@ -41,7 +41,7 @@ class StackLock(object): @staticmethod def engine_alive(context, engine_id): client = rpc_messaging.get_rpc_client( - version='1.0', topic="heat-engine-listener", + version='1.0', topic=rpc_api.LISTENER_TOPIC, server=engine_id) client_context = client.prepare( timeout=cfg.CONF.engine_life_check_timeout) diff --git a/heat/rpc/api.py b/heat/rpc/api.py index 7afe5826ec..9b38c56e69 100644 --- a/heat/rpc/api.py +++ b/heat/rpc/api.py @@ -12,6 +12,7 @@ # under the License. ENGINE_TOPIC = 'engine' +LISTENER_TOPIC = 'heat-engine-listener' PARAM_KEYS = ( PARAM_TIMEOUT, PARAM_DISABLE_ROLLBACK, PARAM_ADOPT_STACK_DATA,