Merge "Fix the concurrency issue agent queue creation and VM agent"
This commit is contained in:
commit
2309247b24
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue