Merge pull request #2387 from oman36/issues-2386-queues-with-different-ApproximateNumberOfMessages
issues-2386 make comparing exists and new queues only by static attrs
This commit is contained in:
commit
b2fddf8469
@ -424,13 +424,26 @@ class SQSBackend(BaseBackend):
|
||||
|
||||
queue_attributes = queue.attributes
|
||||
new_queue_attributes = new_queue.attributes
|
||||
static_attributes = (
|
||||
'DelaySeconds',
|
||||
'MaximumMessageSize',
|
||||
'MessageRetentionPeriod',
|
||||
'Policy',
|
||||
'QueueArn',
|
||||
'ReceiveMessageWaitTimeSeconds',
|
||||
'RedrivePolicy',
|
||||
'VisibilityTimeout',
|
||||
'KmsMasterKeyId',
|
||||
'KmsDataKeyReusePeriodSeconds',
|
||||
'FifoQueue',
|
||||
'ContentBasedDeduplication',
|
||||
)
|
||||
|
||||
for key in ['CreatedTimestamp', 'LastModifiedTimestamp']:
|
||||
queue_attributes.pop(key)
|
||||
new_queue_attributes.pop(key)
|
||||
|
||||
if queue_attributes != new_queue_attributes:
|
||||
raise QueueAlreadyExists("The specified queue already exists.")
|
||||
for key in static_attributes:
|
||||
if queue_attributes.get(key) != new_queue_attributes.get(key):
|
||||
raise QueueAlreadyExists(
|
||||
"The specified queue already exists.",
|
||||
)
|
||||
else:
|
||||
try:
|
||||
kwargs.pop('region')
|
||||
|
Loading…
Reference in New Issue
Block a user