Skip to content

Commit

Permalink
Re-add tags to module_utils.backup.get_plan_details
Browse files Browse the repository at this point in the history
  • Loading branch information
hakbailey committed May 9, 2023
1 parent a8a73d3 commit 178275c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions plugins/module_utils/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,15 @@ def get_plan_details(module, client, backup_plan_name: str):

try:
module.params["resource"] = result.get("BackupPlanArn", None)
# tag_dict = get_backup_resource_tags(module, client)
# result.update({"tags": tag_dict})
tag_dict = get_backup_resource_tags(module, client)
result.update({"tags": tag_dict})
except (botocore.exceptions.BotoCoreError, botocore.exceptions.ClientError) as e:
module.fail_json_aws(e, msg="Failed to get the backup plan tags")

snaked_backup_plan.append(camel_dict_to_snake_dict(result, ignore_list="tags"))

# Turn the boto3 result in to ansible friendly tag dictionary
# Remove AWS API response and add top-level plan name
for v in snaked_backup_plan:
# if "tags_list" in v:
# v["tags"] = boto3_tag_list_to_ansible_dict(v["tags_list"], "key", "value")
if "response_metadata" in v:
del v["response_metadata"]
v["backup_plan_name"] = v["backup_plan"]["backup_plan_name"]
Expand Down

0 comments on commit 178275c

Please sign in to comment.