Adding aliases for field attributes and renaming async attribute (#33141)

* Adding aliases for field attributes and renaming async attribute

As of Python 3.7, the use of async raises an error, whereas before the use
of the reserved word was ignored. This adds an alias field for field attrs
so that both async and async_val (interally) work. This allows us to be
backwards-compatible with 3rd party plugins that may still reference Task.async,
but for the core engine to work on Py3.7+.

* Remove files fixed for 'async' usage from the python 3.7 skip list
This commit is contained in:
James Cammarata 2017-11-22 14:35:58 -06:00 committed by Matt Clay
parent 23f8833e87
commit d8ae4dfbf2
14 changed files with 43 additions and 36 deletions

View file

@ -537,7 +537,7 @@ class TaskExecutor:
if self._task.register:
vars_copy[self._task.register] = wrap_var(result.copy())
if self._task.async > 0:
if self._task.async_val > 0:
if self._task.poll > 0 and not result.get('skipped') and not result.get('failed'):
result = self._poll_async_result(result=result, templar=templar, task_vars=vars_copy)
# FIXME callback 'v2_runner_on_async_poll' here
@ -668,7 +668,7 @@ class TaskExecutor:
shared_loader_obj=self._shared_loader_obj,
)
time_left = self._task.async
time_left = self._task.async_val
while time_left > 0:
time.sleep(self._task.poll)