mirror of
https://github.com/famedly/ansible-collection-base
synced 2024-11-10 06:24:17 +00:00
fix(gpg_secretstore): ensure import errors get properly passed to fail_json
This commit is contained in:
parent
f54e12561b
commit
0e98261665
1 changed files with 3 additions and 2 deletions
|
@ -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"],
|
||||
|
|
Loading…
Reference in a new issue