1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

java_certs : Not enough info on error (#5550)

* java_certs : Not enough info on error

Just bumped into an issue when the message was "Internal module failure, cannot extract public certificate from pkcs12, error: "
Seems that the issue #2560 doesn't cover all cases. To make debugging easier, I propose to add error output on json return instead of only expose standard output.

* java_certs - add missing fragment message

* Word-smithing.

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Naewis 2022-11-28 22:44:24 +01:00 committed by GitHub
parent 3f80aa3c63
commit 1ca775248f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- java_certs - add more detailed error output when extracting certificate from PKCS12 fails (https://github.com/ansible-collections/community.general/pull/5550).

View file

@ -281,7 +281,8 @@ def _export_public_cert_from_pkcs12(module, executable, pkcs_file, alias, passwo
(export_rc, export_stdout, export_err) = module.run_command(export_cmd, data=password, check_rc=False) (export_rc, export_stdout, export_err) = module.run_command(export_cmd, data=password, check_rc=False)
if export_rc != 0: if export_rc != 0:
module.fail_json(msg="Internal module failure, cannot extract public certificate from pkcs12, error: %s" % export_stdout, module.fail_json(msg="Internal module failure, cannot extract public certificate from PKCS12, message: %s" % export_stdout,
stderr=export_err,
rc=export_rc) rc=export_rc)
with open(dest, 'w') as f: with open(dest, 'w') as f: