ansible_mitogen: Remove unneeded internal _run_cmd()

pull/1213/head
Alex Willmer 10 months ago
parent 1b8b2c8b1a
commit 356be2e65f

@ -476,18 +476,12 @@ class ActionModuleMixin(ansible.plugins.action.ActionBase):
# not used, just adding a filler value
possible_pythons = ['python']
def _run_cmd():
return self._connection.exec_command(
cmd=cmd,
in_data=in_data,
sudoable=sudoable,
mitogen_chdir=chdir,
)
for possible_python in possible_pythons:
try:
self._mitogen_interpreter_candidate = possible_python
rc, stdout, stderr = _run_cmd()
rc, stdout, stderr = self._connection.exec_command(
cmd, in_data, sudoable, mitogen_chdir=chdir,
)
# TODO: what exception is thrown?
except:
# we've reached the last python attempted and failed

Loading…
Cancel
Save