Skip to content

Commit

Permalink
k8s_info: add async support
Browse files Browse the repository at this point in the history
  • Loading branch information
gaelgatelement committed Jun 13, 2023
1 parent 318529a commit 2d06a22
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions plugins/action/k8s_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ def get_kubeconfig(self, kubeconfig, remote_transport, new_module_args):

def run(self, tmp=None, task_vars=None):
"""handler for k8s options"""
self._supports_async = True
if task_vars is None:
task_vars = dict()

Expand Down Expand Up @@ -364,7 +365,7 @@ def run(self, tmp=None, task_vars=None):
# src is on remote node
result.update(
self._execute_module(
module_name=self._task.action, task_vars=task_vars
module_name=self._task.action, task_vars=task_vars, wrap_async=self._task.async_val
)
)
return self._ensure_invocation(result)
Expand Down Expand Up @@ -396,10 +397,12 @@ def run(self, tmp=None, task_vars=None):
module_name=self._task.action,
module_args=new_module_args,
task_vars=task_vars,
wrap_async=self._task.async_val
)

# Delete tmp path
self._remove_tmp_path(self._connection._shell.tmpdir)
if not self._task.async_val:
self._remove_tmp_path(self._connection._shell.tmpdir)

result.update(module_return)

Expand Down

0 comments on commit 2d06a22

Please sign in to comment.