Pass the correct object to local module check

The normal action plugin was passing module_name when the code path
actually needed the module object itself.

Change-Id: Idb8968a7020ffb159d0d016b5bfab6bd88219c70
This commit is contained in:
Monty Taylor 2017-08-31 14:04:53 -05:00
parent 1b22179d20
commit cee3fc7dd1
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
2 changed files with 4 additions and 4 deletions

View File

@ -50,7 +50,7 @@ class ActionModule(normal.ActionModule):
handler_name = 'handle_{action}'.format(action=self._task.action)
handler = getattr(self, handler_name, None)
if handler:
paths._fail_if_local_module(self._task.action)
paths._fail_if_local_module(self)
handler()
return True
return False

View File

@ -91,7 +91,7 @@ def _fail_module_dict(module_name):
name=module_name))
def _fail_if_local_module(module_name):
if not _is_official_module(module_name):
msg_dict = _fail_module_dict(module_name)
def _fail_if_local_module(module):
if not _is_official_module(module):
msg_dict = _fail_module_dict(module._task.action)
raise AnsibleError(msg_dict['msg'])