Allow "True" in SQS Queue boolean attributes (#4830)

This commit is contained in:
Cristopher Pinzón 2022-02-07 18:53:25 -05:00 committed by GitHub
parent 87dfa2e922
commit c25aae0d9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -327,7 +327,7 @@ class Queue(CloudFormationModel):
if key in integer_fields: if key in integer_fields:
value = int(value) value = int(value)
if key in bool_fields: if key in bool_fields:
value = value == "true" value = str(value).lower() == "true"
if key in ["Policy", "RedrivePolicy"] and value is not None: if key in ["Policy", "RedrivePolicy"] and value is not None:
continue continue

View File

@ -264,7 +264,7 @@ dummy_redrive_template = {
}, },
"DeadLetterQueue": { "DeadLetterQueue": {
"Type": "AWS::SQS::Queue", "Type": "AWS::SQS::Queue",
"Properties": {"FifoQueue": True}, "Properties": {"QueueName": "deadletterqueue.fifo", "FifoQueue": True},
}, },
}, },
} }

View File

@ -95,12 +95,12 @@ def test_create_queue_with_different_attributes_fail():
raise RuntimeError("Should of raised QueueAlreadyExists Exception") raise RuntimeError("Should of raised QueueAlreadyExists Exception")
q_name2 = str(uuid4())[0:6] q_name2 = str(uuid4())[0:6]
response = sqs.create_queue(QueueName=q_name2, Attributes={"FifoQueue": "True"}) response = sqs.create_queue(QueueName=q_name2, Attributes={"FifoQueue": "tru"})
attributes = {"VisibilityTimeout": "60"} attributes = {"VisibilityTimeout": "60"}
sqs.set_queue_attributes(QueueUrl=response.get("QueueUrl"), Attributes=attributes) sqs.set_queue_attributes(QueueUrl=response.get("QueueUrl"), Attributes=attributes)
new_response = sqs.create_queue(QueueName=q_name2, Attributes={"FifoQueue": "True"}) new_response = sqs.create_queue(QueueName=q_name2, Attributes={"FifoQueue": "tru"})
new_response["QueueUrl"].should.equal(response.get("QueueUrl")) new_response["QueueUrl"].should.equal(response.get("QueueUrl"))