From eb4813f1ca735917ec04662932e6ba39877f0034 Mon Sep 17 00:00:00 2001 From: Mike Mars Date: Sat, 4 Jun 2016 17:35:48 -0700 Subject: [PATCH] a) fail_json uses kwargs, b) outside the fork, log instead of returning json on stdout. --- lib/ansible/modules/utilities/helper/accelerate.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/utilities/helper/accelerate.py b/lib/ansible/modules/utilities/helper/accelerate.py index 27f714ad23a..074f1d173b2 100644 --- a/lib/ansible/modules/utilities/helper/accelerate.py +++ b/lib/ansible/modules/utilities/helper/accelerate.py @@ -171,7 +171,7 @@ def daemonize_self(module, password, port, minutes, pid_file): except OSError: e = get_exception() message = "fork #1 failed: %d (%s)" % (e.errno, e.strerror) - module.fail_json(message) + module.fail_json(msg=message) # decouple from parent environment os.chdir("/") @@ -190,8 +190,8 @@ def daemonize_self(module, password, port, minutes, pid_file): sys.exit(0) except OSError: e = get_exception() - message = 'fork #2 failed: %d (%s)' % (e.errno, e.strerror) - module.fail_json(message) + log('fork #2 failed: %d (%s)' % (e.errno, e.strerror)) + sys.exit(1) dev_null = file('/dev/null','rw') os.dup2(dev_null.fileno(), sys.stdin.fileno())