From a5688ec7a764e961f5a37104bb5819ccc73f0f56 Mon Sep 17 00:00:00 2001 From: Jiri Podivin Date: Wed, 15 Feb 2023 15:09:22 +0100 Subject: [PATCH] Setting default value of the 'default_values' argument Existing implementation could lead to module failing with exception if defaults were not provided. Resolves: rhbz#2136519 Signed-off-by: Jiri Podivin Change-Id: I02d2452347b0ab6d7f79d2756b5f5dbc5f0cef84 (cherry picked from commit 26935da3009b7e27004bf9b38054097870af3a0a) --- .../ansible_plugins/modules/tripleo_overcloud_role_show.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tripleo_ansible/ansible_plugins/modules/tripleo_overcloud_role_show.py b/tripleo_ansible/ansible_plugins/modules/tripleo_overcloud_role_show.py index 3dd274bad..565897a2e 100644 --- a/tripleo_ansible/ansible_plugins/modules/tripleo_overcloud_role_show.py +++ b/tripleo_ansible/ansible_plugins/modules/tripleo_overcloud_role_show.py @@ -70,6 +70,7 @@ options: - Used only when the keys aren't already defined within the role. required: false type: dict + default: {{}} author: - Jiri Podivin ''' @@ -160,7 +161,7 @@ def run_module(): try: roles_path = module.params['roles_path'] environment_path = module.params['environment_path'] - default_values = module.params.get('default_values', {}) + default_values = module.params['default_values'] role_name = module.params['role_name'] roles_path = os.path.join(roles_path, '{}.yaml'.format(role_name))