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 (#1813) (#1814)

[PR #1813/985d8b1c backport][stable-6] s3_object - fix NoSuchTagSet error when S3 endpoint doesn't support tags

This is a backport of PR #1813 as merged into main (985d8b1).
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: #1607

Reviewed-by: Mark Chappell
  • Loading branch information
patchback[bot] authored Oct 20, 2023
1 parent e14e0a0 commit ccb0af5
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 @@ -957,7 +957,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 ccb0af5

Please sign in to comment.