Skip to content

Commit

Permalink
s3_object - fix NoSuchTagSet error when S3 endpoint doesn't support t…
Browse files Browse the repository at this point in the history
…ags (ansible-collections#1813)

s3_object - fix NoSuchTagSet error when S3 endpoint doesn't support tags

SUMMARY
is_boto3_error_code only supports being passed a string or list.  In the refactor of s3_object it was passed a tuple, so the errors weren't being cleanly caught.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
s3_object
ADDITIONAL INFORMATION
fixes: ansible-collections#1607

Reviewed-by: Alina Buzachis
  • Loading branch information
tremble authored Oct 19, 2023
1 parent 0156ebc commit 985d8b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/1607-NoSuchTagSet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- s3_object - fixed ``NoSuchTagSet`` error when S3 endpoint doesn't support tags (https://github.com/ansible-collections/amazon.aws/issues/1607).
2 changes: 1 addition & 1 deletion plugins/modules/s3_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ def get_current_object_tags_dict(module, s3, bucket, obj, version=None):
except is_boto3_error_code(IGNORE_S3_DROP_IN_EXCEPTIONS):
module.warn("GetObjectTagging is not implemented by your storage provider.")
return {}
except is_boto3_error_code(("NoSuchTagSet", "NoSuchTagSetError")):
except is_boto3_error_code(["NoSuchTagSet", "NoSuchTagSetError"]):
return {}
return boto3_tag_list_to_ansible_dict(current_tags)

Expand Down

0 comments on commit 985d8b1

Please sign in to comment.