Fix saving of tracebacks on module failure

This commit is contained in:
Toshio Kuratomi 2016-03-15 20:31:40 -07:00
parent 6b1b4e03b0
commit fe278202f2
2 changed files with 7 additions and 8 deletions

View file

@ -327,6 +327,6 @@ class ActionModule(ActionBase):
if 'SyntaxError' in result.get('exception', result.get('msg', '')):
# Emit a warning about using python3 because synchronize is
# somewhat unique in running on localhost
result['traceback'] = result['msg']
result['exception'] = result['msg']
result['msg'] = 'SyntaxError parsing module. Perhaps invoking "python" on your local (or delegate_to) machine invokes python3. You can set ansible_python_interpreter for localhost (or the delegate_to machine) to the location of python2 to fix this'
return result