From d89b2141640497b137c2b2c424ef209425893b06 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Wed, 7 Mar 2018 20:04:05 +0545 Subject: [PATCH] issue #109: do exactly what Ansible does Could it be that some empty dict magically gets populated from somewhere invisible? --- ansible_mitogen/mixins.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ansible_mitogen/mixins.py b/ansible_mitogen/mixins.py index 8dd43255..48b58cde 100644 --- a/ansible_mitogen/mixins.py +++ b/ansible_mitogen/mixins.py @@ -259,9 +259,12 @@ class ActionModuleMixin(ansible.plugins.action.ActionBase): helpers.run_module() or helpers.run_module_async() in the target context. """ - module_name = module_name or self._task.action - module_args = module_args or self._task.args - task_vars = task_vars or {} + if task_vars is None: + task_vars = {} + if module_name is None: + module_name = self._task.action + if module_args is None: + module_args = self._task.args self._update_module_args(module_name, module_args, task_vars) if wrap_async: