Skip to content

Commit

Permalink
Pass module into get_current_object_tags_dict so we can warn
Browse files Browse the repository at this point in the history
  • Loading branch information
tremble committed Jan 3, 2023
1 parent e577e35 commit d341daa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugins/modules/s3_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ def copy_object_to_bucket(
)


def get_current_object_tags_dict(s3, bucket, obj, version=None):
def get_current_object_tags_dict(module, s3, bucket, obj, version=None):
try:
if version:
current_tags = s3.get_object_tagging(
Expand Down Expand Up @@ -1042,7 +1042,7 @@ def wait_tags_are_applied(
for _dummy in range(0, 12):
try:
current_tags_dict = get_current_object_tags_dict(
s3, bucket, obj, version
module, s3, bucket, obj, version
)
except (
botocore.exceptions.ClientError,
Expand All @@ -1068,7 +1068,7 @@ def ensure_tags(client, module, bucket, obj):
changed = False

try:
current_tags_dict = get_current_object_tags_dict(client, bucket, obj)
current_tags_dict = get_current_object_tags_dict(module, client, bucket, obj)
except (
botocore.exceptions.BotoCoreError,
botocore.exceptions.ClientError,
Expand Down Expand Up @@ -1346,6 +1346,7 @@ def s3_object_do_geturl(module, connection, connection_v4, s3_vars):
validate=s3_vars["validate"],
):
tags = get_current_object_tags_dict(
module,
connection,
s3_vars["bucket"],
s3_vars["object"],
Expand Down

0 comments on commit d341daa

Please sign in to comment.