From a200cfb07f5c0244223bd252e6d2ef2fd35deb1d Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Wed, 6 Feb 2019 06:45:35 +0100 Subject: [PATCH] acme_challenge_cert_helper: fix bad module.fail_json() call (#51795) * Fix bad module.fail_json() call. * Add changelog. (cherry picked from commit c9b08db97950e8572f2c7ec4c0d4ebc44c2ea0a1) --- .../fragments/51795-acme_challenge_cert_helper-module-fail.yaml | 2 ++ lib/ansible/modules/crypto/acme/acme_challenge_cert_helper.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/51795-acme_challenge_cert_helper-module-fail.yaml diff --git a/changelogs/fragments/51795-acme_challenge_cert_helper-module-fail.yaml b/changelogs/fragments/51795-acme_challenge_cert_helper-module-fail.yaml new file mode 100644 index 00000000000..e09ff0f3e78 --- /dev/null +++ b/changelogs/fragments/51795-acme_challenge_cert_helper-module-fail.yaml @@ -0,0 +1,2 @@ +bugfixes: +- "acme_challenge_cert_helper - the module no longer crashes when the required ``cryptography`` library cannot be found." diff --git a/lib/ansible/modules/crypto/acme/acme_challenge_cert_helper.py b/lib/ansible/modules/crypto/acme/acme_challenge_cert_helper.py index 0f41b3514e7..cea3d87acc8 100644 --- a/lib/ansible/modules/crypto/acme/acme_challenge_cert_helper.py +++ b/lib/ansible/modules/crypto/acme/acme_challenge_cert_helper.py @@ -172,7 +172,7 @@ def main(): ), ) if not HAS_CRYPTOGRAPHY: - module.fail(msg='cryptography >= 1.3 is required for this module.') + module.fail_json(msg='cryptography >= 1.3 is required for this module.') try: # Get parameters