Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UnboundLocalError in sqs_queue #389

Merged
merged 3 commits into from
Mar 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/389-sqs-queue-UnboundLocalError.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- sqs_queue - fix UnboundLocalError when passing a boolean parameter (https://github.com/ansible-collections/community.aws/issues/172).
2 changes: 1 addition & 1 deletion plugins/modules/sqs_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 22 additions & 0 deletions tests/integration/targets/sqs_queue/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}" }