diff --git a/ansible_mitogen/connection.py b/ansible_mitogen/connection.py index a3f66eacc..d5628889b 100644 --- a/ansible_mitogen/connection.py +++ b/ansible_mitogen/connection.py @@ -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 @@ -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 diff --git a/ansible_mitogen/plugins/connection/mitogen_ssh.py b/ansible_mitogen/plugins/connection/mitogen_ssh.py index 75f2d42fb..d977b6fd8 100644 --- a/ansible_mitogen/plugins/connection/mitogen_ssh.py +++ b/ansible_mitogen/plugins/connection/mitogen_ssh.py @@ -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, )