Exemple #1
0
def get_sqs_queues(filter='.*', pool={}, env=None, region=None):
    result = []
    try:
        sqs_client = _connect('sqs', env=env, region=region)
        out = sqs_client.list_queues()
        queues = out['QueueUrls']
        for q in queues:
            name = q.split('/')[-1]
            arn = aws_stack.sqs_queue_arn(name)
            if re.match(filter, name):
                queue = SqsQueue(arn)
                result.append(queue)
    except Exception:
        pass
    return result
Exemple #2
0
def get_sqs_queues(filter='.*', pool={}, env=None):
    result = []
    try:
        out = cmd_sqs('list-queues', env)
        if not out.strip():
            return result
        queues = json.loads(out)['QueueUrls']
        for q in queues:
            name = q.split('/')[-1]
            arn = aws_stack.sqs_queue_arn(name)
            if re.match(filter, name):
                queue = SqsQueue(arn)
                result.append(queue)
    except Exception:
        pass
    return result
def get_sqs_queues(filter='.*', pool={}, env=None):
    result = []
    try:
        out = cmd_sqs('list-queues', env)
        if not out.strip():
            return result
        queues = json.loads(out)['QueueUrls']
        for q in queues:
            name = q.split('/')[-1]
            account = q.split('/')[-2]
            arn = 'arn:aws:sqs:%s:%s:%s' % (DEFAULT_REGION, account, name)
            if re.match(filter, name):
                queue = SqsQueue(arn)
                result.append(queue)
    except socket.error:
        pass
    return result
Exemple #4
0
def get_sqs_queues(filter=".*", pool=None, env=None, region=None):
    if pool is None:
        pool = {}
    result = []
    try:
        sqs_client = _connect("sqs", env=env, region=region)
        out = sqs_client.list_queues()
        queues = out["QueueUrls"]
        for q in queues:
            name = q.split("/")[-1]
            arn = aws_stack.sqs_queue_arn(name)
            if re.match(filter, name):
                queue = SqsQueue(arn)
                result.append(queue)
    except Exception:
        pass
    return result
Exemple #5
0
def get_sqs_queues(filter='.*', pool={}, env=None):
    result = []
    try:
        sqs_client = aws_stack.connect_to_service('sqs')
        out = sqs_client.list_queues()
        if not out.strip():
            return result
        queues = out['QueueUrls']
        for q in queues:
            name = q.split('/')[-1]
            arn = aws_stack.sqs_queue_arn(name)
            if re.match(filter, name):
                queue = SqsQueue(arn)
                result.append(queue)
    except Exception:
        pass
    return result