From 300bc84e3aeb8005fd662efeaa886946331cdbe7 Mon Sep 17 00:00:00 2001 From: David Boucha Date: Fri, 18 Apr 2014 12:37:56 -0600 Subject: [PATCH] Check for existence of queue first --- salt/modules/aws_sqs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/salt/modules/aws_sqs.py b/salt/modules/aws_sqs.py index 7912c4f67a..235754fbd2 100644 --- a/salt/modules/aws_sqs.py +++ b/salt/modules/aws_sqs.py @@ -92,6 +92,8 @@ def receive_message(queue, region, num=1, opts=None, user=None): ''' queues = list_queues(region, opts, user) url_map = _parse_queue_list(queues) + if queue not in url_map: + return '"{0}" queue does not exist.'.format(queue) out = _run_aws('receive-message', region, opts, user, queue=url_map[queue], num=num)