From 8fb88be41b47c42c21911b7c609793808dba903b Mon Sep 17 00:00:00 2001 From: Chris Church Date: Wed, 8 Oct 2014 11:53:06 -0400 Subject: [PATCH] Simpler fix for module suffixes than c02e8d8c8. --- lib/ansible/runner/__init__.py | 2 +- lib/ansible/utils/plugins.py | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index 19c90ba529..cb32a70525 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -1224,7 +1224,7 @@ class Runner(object): # Search module path(s) for named module. module_suffixes = getattr(conn, 'default_suffixes', None) - module_path = utils.plugins.module_finder.find_plugin(module_name, module_suffixes, transport=self.transport) + module_path = utils.plugins.module_finder.find_plugin(module_name, module_suffixes) if module_path is None: module_path2 = utils.plugins.module_finder.find_plugin('ping', module_suffixes) if module_path2 is not None: diff --git a/lib/ansible/utils/plugins.py b/lib/ansible/utils/plugins.py index faf5b5f26f..5b55a0ee89 100644 --- a/lib/ansible/utils/plugins.py +++ b/lib/ansible/utils/plugins.py @@ -155,17 +155,14 @@ class PluginLoader(object): self._extra_dirs.append(directory) self._paths = None - def find_plugin(self, name, suffixes=None, transport=''): + def find_plugin(self, name, suffixes=None): ''' Find a plugin named name ''' if not suffixes: if self.class_name: suffixes = ['.py'] else: - if transport == 'winrm': - suffixes = ['.ps1', ''] - else: - suffixes = ['.py', ''] + suffixes = ['.py', ''] for suffix in suffixes: full_name = '%s%s' % (name, suffix)