From 0e98261665527c062d6c0a24c53fcab6e403d5e5 Mon Sep 17 00:00:00 2001 From: transcaffeine Date: Thu, 25 Jan 2024 11:40:01 +0100 Subject: [PATCH] fix(gpg_secretstore): ensure import errors get properly passed to fail_json --- plugins/modules/gpg_secretstore.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/modules/gpg_secretstore.py b/plugins/modules/gpg_secretstore.py index 1037a52..e547dde 100644 --- a/plugins/modules/gpg_secretstore.py +++ b/plugins/modules/gpg_secretstore.py @@ -360,10 +360,11 @@ def main(): error_map = check_secretstore_import_errors() | check_module_import_errors() for lib, exception in error_map.items(): + warnings.append(f"Missing python library: {lib}") errors.append(missing_required_lib(lib)) - traceback.append(exception) + traceback.append(str(exception)) if errors: - module.fail_json(warning=',\n'.join(warnings), errors=errors, traceback="\n".join(traceback)) + module.fail_json(warning=',\n'.join(warnings), errors=errors, traceback="\n".join(traceback), msg=',\n'.join(warnings)) store = SecretStore( password_store_path=module.params["password_store_path"],