Merge "Fix the concurrency issue agent queue creation and VM agent"

This commit is contained in:
Jenkins 2014-08-14 09:55:37 +00:00 committed by Gerrit Code Review
commit 2309247b24
2 changed files with 7 additions and 2 deletions

View File

@ -71,6 +71,7 @@ Methods:
deploy:
Body:
- $securityGroupName: coalesce(
$.securityGroupName,
$.environment.securityGroupManager.defaultGroupName
@ -90,7 +91,8 @@ Methods:
- $preparedUserData: $.prepareUserData()
- $userData: $preparedUserData.data
- $userDataFormat: $preparedUserData.format
# Create MQ queue to communicate with the VM
- $.agent.prepare()
- $template:
resources:
$.name:

View File

@ -59,6 +59,10 @@ class Agent(murano_object.MuranoObject):
def enabled(self):
return self._enabled
def prepare(self):
with common.create_rmq_client() as client:
client.declare(self._queue, enable_ha=True, ttl=86400000)
def queueName(self):
return self._queue
@ -82,7 +86,6 @@ class Agent(murano_object.MuranoObject):
msg.id = msg_id
with common.create_rmq_client() as client:
client.declare(self._queue, enable_ha=True, ttl=86400000)
client.send(message=msg, key=self._queue)
if wait_results: