Creating a queue with existing name is now a no-op
This is more in line with Amazon's CreateQueue API (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_CreateQueue.html). Previously, calling create_queue with a name that already existed would cause moto to overwrite the existing queue with a new empty one.
This commit is contained in:
parent
cfda83dcba
commit
18bad6994d
1 changed files with 4 additions and 2 deletions
|
|
@ -158,8 +158,10 @@ class SQSBackend(BaseBackend):
|
|||
super(SQSBackend, self).__init__()
|
||||
|
||||
def create_queue(self, name, visibility_timeout):
|
||||
queue = Queue(name, visibility_timeout)
|
||||
self.queues[name] = queue
|
||||
queue = self.queues.get(name)
|
||||
if queue is None:
|
||||
queue = Queue(name, visibility_timeout)
|
||||
self.queues[name] = queue
|
||||
return queue
|
||||
|
||||
def list_queues(self, queue_name_prefix):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue