From 39302a7a91b8c9c64ea9d0995ab5dc6f955ffaf4 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Tue, 9 May 2023 17:27:47 +0200 Subject: [PATCH] backup_selection_info - ensure result is returned as snake_case rather than CamelCase Signed-off-by: Alina Buzachis --- changelogs/fragments/backup_selection-return_snake_case.yml | 2 ++ plugins/modules/backup_selection_info.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/backup_selection-return_snake_case.yml diff --git a/changelogs/fragments/backup_selection-return_snake_case.yml b/changelogs/fragments/backup_selection-return_snake_case.yml new file mode 100644 index 00000000000..16d502a648c --- /dev/null +++ b/changelogs/fragments/backup_selection-return_snake_case.yml @@ -0,0 +1,2 @@ +trivial: + - "backup_selection_info ensure result is returned as snake_case rather than CamelCase." diff --git a/plugins/modules/backup_selection_info.py b/plugins/modules/backup_selection_info.py index dcb8f6571a2..2beb66db03e 100644 --- a/plugins/modules/backup_selection_info.py +++ b/plugins/modules/backup_selection_info.py @@ -114,6 +114,7 @@ from ansible_collections.amazon.aws.plugins.module_utils.modules import AnsibleAWSModule from ansible_collections.amazon.aws.plugins.module_utils.retries import AWSRetry from ansible_collections.amazon.aws.plugins.module_utils.backup import get_selection_details +from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict def main(): @@ -133,7 +134,7 @@ def main(): result["backup_selections"] = get_selection_details( module, client, module.params.get("backup_plan_name"), module.params.get("backup_selection_names") ) - module.exit_json(**result) + module.exit_json(**camel_dict_to_snake_dict(result)) if __name__ == "__main__":