From 214b4576361529fa995a908744d0f478524b0201 Mon Sep 17 00:00:00 2001 From: Serg Melikyan Date: Fri, 22 Nov 2013 18:28:48 +0400 Subject: [PATCH] Enable HA & TTL on declared queues Change-Id: Idaed8621e4c14c49d9173243ec5af444e9a3a80e --- muranoconductor/app.py | 4 ++-- muranoconductor/commands/vm_agent.py | 4 ++-- muranoconductor/reporting.py | 2 +- requirements.txt | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/muranoconductor/app.py b/muranoconductor/app.py index 82d7b0f..bdb3642 100644 --- a/muranoconductor/app.py +++ b/muranoconductor/app.py @@ -63,8 +63,8 @@ class ConductorWorkflowService(service.Service): while True: try: with self.create_rmq_client() as mq: - mq.declare('tasks', 'tasks') - mq.declare('task-results') + mq.declare('tasks', 'tasks', enable_ha=True) + mq.declare('task-results', enable_ha=True) with mq.open('tasks', prefetch_count= cfg.CONF.max_environments) as subscription: diff --git a/muranoconductor/commands/vm_agent.py b/muranoconductor/commands/vm_agent.py index 4720b62..69f7a3d 100644 --- a/muranoconductor/commands/vm_agent.py +++ b/muranoconductor/commands/vm_agent.py @@ -19,7 +19,7 @@ class VmAgentExecutor(CommandBase): self._pending_list = [] self._results_queue = '-execution-results-%s' % str(stack).lower() self._reporter = reporter - rmqclient.declare(self._results_queue) + rmqclient.declare(self._results_queue, enable_ha=True, ttl=86400000) def execute(self, template, mappings, unit, service, callback, metadata_id, timeout=None): @@ -46,7 +46,7 @@ class VmAgentExecutor(CommandBase): msg = Message() msg.body = template msg.id = msg_id - self._rmqclient.declare(queue) + self._rmqclient.declare(queue, enable_ha=True, ttl=86400000) self._rmqclient.send(message=msg, key=queue) log.info('Sending RMQ message {0} to {1} with id {2}'.format( TokenSanitizer().sanitize(template), queue, msg_id)) diff --git a/muranoconductor/reporting.py b/muranoconductor/reporting.py index 2463925..5c15f8c 100644 --- a/muranoconductor/reporting.py +++ b/muranoconductor/reporting.py @@ -24,7 +24,7 @@ class Reporter(object): self._rmqclient = rmqclient self._task_id = task_id self._environment_id = environment_id - rmqclient.declare('task-reports') + rmqclient.declare('task-reports', enable_ha=True) def report_generic(self, text, details=None, level='info'): return self._report_func(None, None, text, details, level) diff --git a/requirements.txt b/requirements.txt index 59793b7..eded9a5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,8 @@ netaddr>=0.7.6 oslo.config>=1.2.0 deep -murano-common>=0.2.2 +# Please, revert to murano-common>=x.x.x before release +http://tarballs.openstack.org/murano-common/murano-common-master.tar.gz#egg=murano-common-0.4 PyYAML>=3.1.0 murano-metadataclient==0.4.a13.gd65dfd2 python-neutronclient>=2.3.1