From c546c12b60e11ebce42ceaf2d4486832f15610c7 Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Mon, 19 Dec 2016 16:54:31 -0500 Subject: [PATCH] fixes incorrect module name for action plugin (#19535) This fixes a bug introduced in the action plugin for setting the module name value for logging --- lib/ansible/plugins/action/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/plugins/action/__init__.py b/lib/ansible/plugins/action/__init__.py index d28adf25b1..7fa65ed6ea 100644 --- a/lib/ansible/plugins/action/__init__.py +++ b/lib/ansible/plugins/action/__init__.py @@ -517,7 +517,7 @@ class ActionBase(with_metaclass(ABCMeta, object)): data = re.sub(r'^((\r)?\n)?BECOME-SUCCESS.*(\r)?\n', '', data) return data - def _update_module_args(self, module_args, task_vars): + def _update_module_args(self, module_name, module_args, task_vars): # set check mode in the module arguments, if required if self._play_context.check_mode: @@ -543,7 +543,7 @@ class ActionBase(with_metaclass(ABCMeta, object)): module_args['_ansible_version'] = __version__ # give the module information about its name - module_args['_ansible_module_name'] = self._task.action + module_args['_ansible_module_name'] = module_name # set the syslog facility to be used in the module module_args['_ansible_syslog_facility'] = task_vars.get('ansible_syslog_facility', C.DEFAULT_SYSLOG_FACILITY) @@ -568,7 +568,7 @@ class ActionBase(with_metaclass(ABCMeta, object)): # Get the connection user for permission checks remote_user = task_vars.get('ansible_ssh_user') or self._play_context.remote_user - self._update_module_args(module_args, task_vars) + self._update_module_args(module_name, module_args, task_vars) (module_style, shebang, module_data, module_path) = self._configure_module(module_name=module_name, module_args=module_args, task_vars=task_vars) display.vvv("Using module file %s" % module_path)