From 5aa6ddef7f17a7ce611b3bd0e02e580c0cf55037 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Thu, 11 Sep 2014 12:26:54 -0400 Subject: [PATCH] Tracebacks are now catchable with ignore_errors and have streamlined output. Also removes 'baby-JSON' for bash modules. --- system/ping | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/system/ping b/system/ping index 4bda3971504..b098d0054cd 100644 --- a/system/ping +++ b/system/ping @@ -37,6 +37,8 @@ EXAMPLES = ''' ansible webservers -m ping ''' +import exceptions + def main(): module = AnsibleModule( argument_spec = dict( @@ -46,6 +48,8 @@ def main(): ) result = dict(ping='pong') if module.params['data']: + if module.params['data'] == 'crash': + raise exceptions.Exception("boom") result['ping'] = module.params['data'] module.exit_json(**result)