mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-08 17:29:11 -07:00
Plug-ins loaded from top-level plug-in directory
PluginLoader._get_paths, as of 391fb98e
, was only finding plug-ins that
were in a subdirectory of one of the basedirs (i.e. in a category
directory). For example, action_plugins/foo.py would never be loaded,
but action_plugins/bar/foo.py would work.
This makes it so that "uncategorized" plug-ins in the top level of a
directory such as action_plugins will be loaded, though plug-ins in a
"category" subdirectory will still be preferred. For example,
action_plugins/bar/foo.py would be preferred over action_plugins/foo.py.
This commit is contained in:
parent
1d3782cfc7
commit
611d56dc4c
5 changed files with 46 additions and 3 deletions
|
@ -100,11 +100,10 @@ class PluginLoader(object):
|
|||
files = glob.glob("%s/*" % fullpath)
|
||||
for file in files:
|
||||
if os.path.isdir(file) and file not in ret:
|
||||
ret.append(file)
|
||||
else:
|
||||
ret.append(file)
|
||||
if fullpath not in ret:
|
||||
ret.append(fullpath)
|
||||
|
||||
|
||||
# look in any configured plugin paths, allow one level deep for subcategories
|
||||
configured_paths = self.config.split(os.pathsep)
|
||||
for path in configured_paths:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue