From 0858d97c44b1e0d2bf2b08165169aa4f11cdc6fa Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 24 Jul 2015 18:42:53 -0400 Subject: [PATCH] also captures typeerrors for when not getting a proper string in output --- lib/ansible/executor/task_executor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py index 36408856dc5..e334a21e7e0 100644 --- a/lib/ansible/executor/task_executor.py +++ b/lib/ansible/executor/task_executor.py @@ -295,7 +295,7 @@ class TaskExecutor: # response, so we parse it here and replace the result try: result = json.loads(result.get('stdout')) - except ValueError, e: + except (TypeError, ValueError) as e: return dict(failed=True, msg="The async task did not return valid JSON: %s" % str(e)) if self._task.poll > 0: