mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Don't search powershell modules unless using the winrm connection.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user