From 1b88df0bdab666ad25b540d5d58c047ee5f01abe Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Thu, 16 Jun 2016 12:21:57 -0700 Subject: [PATCH] Fix exception handling in async_wrapper --- lib/ansible/modules/utilities/logic/async_wrapper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/utilities/logic/async_wrapper.py b/lib/ansible/modules/utilities/logic/async_wrapper.py index fd7699d17a..d6100ba6d0 100644 --- a/lib/ansible/modules/utilities/logic/async_wrapper.py +++ b/lib/ansible/modules/utilities/logic/async_wrapper.py @@ -202,11 +202,11 @@ if __name__ == '__main__': except SystemExit: # On python2.4, SystemExit is a subclass of Exception. # This block makes python2.4 behave the same as python2.5+ - e = get_exception() + e = sys.exc_info()[1] sys.exit(e.code) except Exception: - e = get_exception() + e = sys.exc_info()[1] notice("error: %s"%(e)) print(json.dumps({ "failed" : True,