mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
Don't search powershell modules unless using the winrm connection.
This commit is contained in:
parent
3908d50b03
commit
c02e8d8c80
3 changed files with 7 additions and 4 deletions
|
@ -159,14 +159,17 @@ class PluginLoader(object):
|
|||
if directory not in self._extra_dirs:
|
||||
self._extra_dirs.append(directory)
|
||||
|
||||
def find_plugin(self, name, suffixes=None):
|
||||
def find_plugin(self, name, suffixes=None, transport=''):
|
||||
''' Find a plugin named name '''
|
||||
|
||||
if not suffixes:
|
||||
if self.class_name:
|
||||
suffixes = ['.py']
|
||||
else:
|
||||
suffixes = ['', '.ps1', '.py']
|
||||
if transport == 'winrm':
|
||||
suffixes = ['.ps1', '']
|
||||
else:
|
||||
suffixes = ['.py', '']
|
||||
|
||||
for suffix in suffixes:
|
||||
full_name = '%s%s' % (name, suffix)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue