Skip to content

Commit 0656c0d

Browse files
k8s_info: add async support
1 parent 9e9962b commit 0656c0d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

plugins/action/k8s_info.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ def get_kubeconfig(self, kubeconfig, remote_transport, new_module_args):
332332

333333
def run(self, tmp=None, task_vars=None):
334334
"""handler for k8s options"""
335+
self._supports_async = True
335336
if task_vars is None:
336337
task_vars = dict()
337338

@@ -364,7 +365,7 @@ def run(self, tmp=None, task_vars=None):
364365
# src is on remote node
365366
result.update(
366367
self._execute_module(
367-
module_name=self._task.action, task_vars=task_vars
368+
module_name=self._task.action, task_vars=task_vars, wrap_async=self._task.async_val
368369
)
369370
)
370371
return self._ensure_invocation(result)
@@ -396,10 +397,12 @@ def run(self, tmp=None, task_vars=None):
396397
module_name=self._task.action,
397398
module_args=new_module_args,
398399
task_vars=task_vars,
400+
wrap_async=self._task.async_val
399401
)
400402

401403
# Delete tmp path
402-
self._remove_tmp_path(self._connection._shell.tmpdir)
404+
if not self._task.async_val:
405+
self._remove_tmp_path(self._connection._shell.tmpdir)
403406

404407
result.update(module_return)
405408

0 commit comments

Comments
 (0)