issues-2386 make comparing exists and new queues only by static attrs

This commit is contained in:
Vladimir 2019-08-23 17:17:10 +03:00
parent 3a5d857a60
commit 8b90a75aa0

View File

@ -424,13 +424,26 @@ class SQSBackend(BaseBackend):
queue_attributes = queue.attributes queue_attributes = queue.attributes
new_queue_attributes = new_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']: for key in static_attributes:
queue_attributes.pop(key) if queue_attributes.get(key) != new_queue_attributes.get(key):
new_queue_attributes.pop(key) raise QueueAlreadyExists(
"The specified queue already exists.",
if queue_attributes != new_queue_attributes: )
raise QueueAlreadyExists("The specified queue already exists.")
else: else:
try: try:
kwargs.pop('region') kwargs.pop('region')