Skip to content

Commit

Permalink
httpapi connection support #1086
Browse files Browse the repository at this point in the history
  • Loading branch information
timansky committed Oct 1, 2024
1 parent 0b895c8 commit d08c30a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ansible_mitogen/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import ansible.constants as C
import ansible.errors
import ansible.plugins.connection
from ansible.plugins.action.normal import ActionModule

import mitogen.core

Expand Down Expand Up @@ -585,7 +586,7 @@ def _get_task_vars(self):
if f.f_code.co_name == 'run':
f_locals = f.f_locals
f_self = f_locals.get('self')
if isinstance(f_self, ansible_mitogen.mixins.ActionModuleMixin):
if isinstance(f_self, ansible_mitogen.mixins.ActionModuleMixin) or (self._play_context.connection == 'httpapi' and isinstance(f_self, ActionModule)):
# backref for python interpreter discovery, should be safe because _get_task_vars
# is always called before running interpreter discovery
self._action = f_self
Expand Down
2 changes: 1 addition & 1 deletion ansible_mitogen/plugins/connection/mitogen_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

class Connection(ansible_mitogen.connection.Connection):
transport = 'ssh'
vanilla_class = ansible_mitogen.loaders.connection_loader__get(
(vanilla_class, _) = ansible_mitogen.loaders.connection_loader__get(
'ssh',
class_only=True,
)
Expand Down

0 comments on commit d08c30a

Please sign in to comment.