Skip to content

Commit 6900e88

Browse files
committed
ansible_mitogen: Fix templated python interpreter with meta: reset_connection
refs #1079
1 parent 941da31 commit 6900e88

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

ansible_mitogen/connection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -948,11 +948,11 @@ def reset(self):
948948
# have an action object, which we need for interpreter_discovery.
949949
# Create a temporary action object for this purpose.
950950
self._action = ansible_mitogen.mixins.ActionModuleMixin(
951-
task=0,
951+
task=task,
952952
connection=self,
953953
play_context=self._play_context,
954-
loader=0,
955-
templar=0,
954+
loader=templar._loader,
955+
templar=templar,
956956
shared_loader_obj=0,
957957
)
958958
self._action_monkey_patched_by_mitogen = True

docs/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ In progress (unreleased)
2323

2424
* :gh:issue:`1079` :mod:`ansible_mitogen`: Fix :ans:mod:`wait_for_connection`
2525
timeout with templated ``ansible_python_interpreter``
26+
* :gh:issue:`1079` :mod:`ansible_mitogen`: Fix templated python interpreter
27+
with `meta: reset_connection`
2628

2729

2830
v0.3.19 (2024-12-02)

tests/ansible/regression/issue_1079__wait_for_connection_timeout.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,15 @@
88
tags:
99
- issue_1079
1010
- wait_for_connection
11+
12+
- hosts: issue1079
13+
gather_facts: false
14+
tasks:
15+
- meta: reset_connection
16+
- name: Wait for connection after reset_connection
17+
wait_for_connection:
18+
timeout: 5
19+
tags:
20+
- issue_1079
21+
- reset_connection
22+
- wait_for_connection

0 commit comments

Comments
 (0)