mirror of
https://github.com/ansible/awx.git
synced 2026-05-03 23:55:28 -02:30
replace janky unique channel name w/ uuid
* postgres notify/listen channel names have size limitations as well as character limitations. Respect those limitations while at the same time generate a unique channel name.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import logging
|
import logging
|
||||||
import string
|
import uuid
|
||||||
import random
|
import random
|
||||||
import json
|
import json
|
||||||
|
|
||||||
@@ -29,8 +29,7 @@ class Control(object):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def generate_reply_queue_name(cls):
|
def generate_reply_queue_name(cls):
|
||||||
letters = string.ascii_lowercase
|
return f"reply_to_{str(uuid.uuid4()).replace('-','_')}"
|
||||||
return 'reply_to_{}'.format(''.join(random.choice(letters) for i in range(8)))
|
|
||||||
|
|
||||||
def control_with_reply(self, command, timeout=5):
|
def control_with_reply(self, command, timeout=5):
|
||||||
logger.warn('checking {} {} for {}'.format(self.service, command, self.queuename))
|
logger.warn('checking {} {} for {}'.format(self.service, command, self.queuename))
|
||||||
|
|||||||
Reference in New Issue
Block a user