From de49880d7901d78a711fc8ee0f039e803d14ba4d Mon Sep 17 00:00:00 2001 From: Abhinav Bansal Date: Mon, 23 Sep 2024 21:20:34 +0530 Subject: [PATCH] Added fix for module.fail_json, now it takes 2 Arguments (#498) * Added fix for module.fail_json, now it takes 2 Arguments. Issue was: https://github.com/nutanix/nutanix.ansible/issues/465 * After running black --- plugins/modules/ntnx_vms.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/modules/ntnx_vms.py b/plugins/modules/ntnx_vms.py index 11ad3fa7..65c7daf8 100644 --- a/plugins/modules/ntnx_vms.py +++ b/plugins/modules/ntnx_vms.py @@ -881,7 +881,8 @@ def update_vm(module, result): if is_vm_on and vm.is_restart_required(): if not module.params.get("force_power_off"): module.fail_json( - "To make these changes, the VM should be restarted, but 'force_power_off' is False" + msg="To make these changes, the VM should be restarted, but 'force_power_off' is False", + **result, ) power_off_vm(vm, module, result)