From eee9982be19a16d860b7e9dde05850e7f8c2276a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 25 Apr 2024 04:51:10 +0200 Subject: Merging upstream version 2.16.6. Signed-off-by: Daniel Baumann --- lib/ansible/executor/task_executor.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/ansible/executor') diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py index 0e7394f..d20635a 100644 --- a/lib/ansible/executor/task_executor.py +++ b/lib/ansible/executor/task_executor.py @@ -841,7 +841,12 @@ class TaskExecutor: # that (with a sleep for "poll" seconds between each retry) until the # async time limit is exceeded. - async_task = Task.load(dict(action='async_status', args={'jid': async_jid}, environment=self._task.environment)) + async_task = Task.load(dict( + action='async_status', + args={'jid': async_jid}, + check_mode=self._task.check_mode, + environment=self._task.environment, + )) # FIXME: this is no longer the case, normal takes care of all, see if this can just be generalized # Because this is an async task, the action handler is async. However, @@ -913,6 +918,7 @@ class TaskExecutor: 'jid': async_jid, 'mode': 'cleanup', }, + 'check_mode': self._task.check_mode, 'environment': self._task.environment, } ) @@ -1086,7 +1092,7 @@ class TaskExecutor: # deals with networking sub_plugins (network_cli/httpapi/netconf) sub = getattr(self._connection, '_sub_plugin', None) - if sub is not None and sub.get('type') != 'external': + if sub and sub.get('type') != 'external': plugin_type = get_plugin_class(sub.get("obj")) varnames.extend(self._set_plugin_options(plugin_type, variables, templar, task_keys)) sub_conn = getattr(self._connection, 'ssh_type_conn', None) -- cgit v1.2.3