diff options
author | Brian Coca <bcoca@users.noreply.github.com> | 2016-08-16 11:59:30 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-16 11:59:30 -0400 |
commit | 5fe9d3c3d514d99f4d76e2752ce54f9470e25e97 (patch) | |
tree | 1758e8cc83b8d3f6ff54f85b6e16b43e43cd2e44 | |
parent | 30268f6bd060bbb980f848b0de250ddbc8f60c5c (diff) | |
download | ansible-5fe9d3c3d514d99f4d76e2752ce54f9470e25e97.tar.gz |
make parsed param private and explicit (#17104)
* make parsed param private and explicit
* fixed missed parsed
-rw-r--r-- | lib/ansible/executor/task_executor.py | 4 | ||||
-rw-r--r-- | lib/ansible/plugins/action/__init__.py | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py index 7d82910b57..7b0802bcb2 100644 --- a/lib/ansible/executor/task_executor.py +++ b/lib/ansible/executor/task_executor.py @@ -594,13 +594,13 @@ class TaskExecutor: # have issues which result in a half-written/unparseable result # file on disk, which manifests to the user as a timeout happening # before it's time to timeout. - if int(async_result.get('finished', 0)) == 1 or ('failed' in async_result and async_result.get('parsed', False)) or 'skipped' in async_result: + if int(async_result.get('finished', 0)) == 1 or ('failed' in async_result and async_result.get('_ansible_parsed', False)) or 'skipped' in async_result: break time_left -= self._task.poll if int(async_result.get('finished', 0)) != 1: - if async_result.get('parsed'): + if async_result.get('_ansible_parsed'): return dict(failed=True, msg="async task did not complete within the requested time") else: return dict(failed=True, msg="async task produced unparseable results", async_result=async_result) diff --git a/lib/ansible/plugins/action/__init__.py b/lib/ansible/plugins/action/__init__.py index d6e4ffbe98..7406df3eed 100644 --- a/lib/ansible/plugins/action/__init__.py +++ b/lib/ansible/plugins/action/__init__.py @@ -670,9 +670,10 @@ class ActionBase(with_metaclass(ABCMeta, object)): def _parse_returned_data(self, res): try: data = json.loads(self._filter_non_json_lines(res.get('stdout', u''))) + data['_ansible_parsed'] = True except ValueError: # not valid json, lets try to capture error - data = dict(failed=True, parsed=False) + data = dict(failed=True, _ansible_parsed=False) data['msg'] = "MODULE FAILURE" data['module_stdout'] = res.get('stdout', u'') if 'stderr' in res: |