mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 20:31:27 -07:00
Merge pull request #9293 from cchurch/module_suffixes
Simpler fix for module suffixes than c02e8d8c8
.
This commit is contained in:
commit
346689f9f2
2 changed files with 3 additions and 6 deletions
|
@ -156,17 +156,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', '']
|
||||
|
||||
potential_names = frozenset('%s%s' % (name, s) for s in suffixes)
|
||||
for full_name in potential_names:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue