mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
[s3_bucket] Cast tag keys and values to text to match the values returned (#46405)
* Cast tag keys and values to text to match the values returned * changelog
This commit is contained in:
committed by
Ryan Brown
parent
7fd31b1da0
commit
b808e1bc5c
5
changelogs/fragments/s3_bucket_fix_non_str_tags.yaml
Normal file
5
changelogs/fragments/s3_bucket_fix_non_str_tags.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
bugfixes:
|
||||||
|
- s3_bucket - Prior to 2.6 using non-text tags worked, although was not idempotent. In 2.6
|
||||||
|
waiters were introduced causing non-text tags to be fatal to the module's completion.
|
||||||
|
This fixes the module failure as well as idempotence using integers as tags.
|
||||||
@@ -230,6 +230,8 @@ def create_or_update_bucket(s3_client, module, location):
|
|||||||
module.fail_json_aws(e, msg="Failed to get bucket tags")
|
module.fail_json_aws(e, msg="Failed to get bucket tags")
|
||||||
|
|
||||||
if tags is not None:
|
if tags is not None:
|
||||||
|
# Tags are always returned as text
|
||||||
|
tags = dict((to_text(k), to_text(v)) for k, v in tags.items())
|
||||||
if current_tags_dict != tags:
|
if current_tags_dict != tags:
|
||||||
if tags:
|
if tags:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user