From a61ff7ccb2522b7ea62a324d30e2d9af2b3ea2ed Mon Sep 17 00:00:00 2001 From: "David M. Lee" Date: Wed, 27 Jan 2021 14:33:40 -0600 Subject: [PATCH 1/3] Fix UnboundLocalError in sqs_queue The variable `existing_value` is nowhere to be found, but looks like this might have been missed in a rename. Changing to `value`. Fixes #172 --- plugins/modules/sqs_queue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/sqs_queue.py b/plugins/modules/sqs_queue.py index b0565c6c8d0..b76cdb31410 100644 --- a/plugins/modules/sqs_queue.py +++ b/plugins/modules/sqs_queue.py @@ -375,7 +375,7 @@ def update_sqs_queue(module, client, queue_url): if isinstance(new_value, bool): new_value = str(new_value).lower() - existing_value = str(existing_value).lower() + value = str(value).lower() if new_value == value: continue From 5a8697974d139e2b91f9df57c71c1f4ee24428ff Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Tue, 16 Mar 2021 12:43:45 +0100 Subject: [PATCH 2/3] integration test --- .../targets/sqs_queue/tasks/main.yml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/integration/targets/sqs_queue/tasks/main.yml b/tests/integration/targets/sqs_queue/tasks/main.yml index b689c9eb2b9..483f17bb298 100644 --- a/tests/integration/targets/sqs_queue/tasks/main.yml +++ b/tests/integration/targets/sqs_queue/tasks/main.yml @@ -104,3 +104,25 @@ with_items: - { name: "{{ create_result.name }}" } - { name: "{{ dead_letter_queue.name }}" } + - name: Test FIFO queue + block: + - name: Creating FIFO queue + sqs_queue: + name: "{{ resource_prefix }}{{ 1000 | random }}" + queue_type: fifo + content_based_deduplication: yes + register: create_result + - name: Assert queue created with configuration + assert: + that: + - create_result.changed + always: + - name: Cleaning up queue + sqs_queue: + name: "{{ item.name }}" + state: absent + register: delete_result + retries: 3 + delay: 3 + with_items: + - { name: "{{ create_result.name }}" } From 5d2a484c10c68e26f604b3d132efc63b82f7567d Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Tue, 16 Mar 2021 12:46:40 +0100 Subject: [PATCH 3/3] changelog --- changelogs/fragments/389-sqs-queue-UnboundLocalError.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/389-sqs-queue-UnboundLocalError.yml diff --git a/changelogs/fragments/389-sqs-queue-UnboundLocalError.yml b/changelogs/fragments/389-sqs-queue-UnboundLocalError.yml new file mode 100644 index 00000000000..8b1b371428f --- /dev/null +++ b/changelogs/fragments/389-sqs-queue-UnboundLocalError.yml @@ -0,0 +1,2 @@ +bugfixes: +- sqs_queue - fix UnboundLocalError when passing a boolean parameter (https://github.com/ansible-collections/community.aws/issues/172).