mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07:00
Enforce alphanumeric ordering for plugins grabbed via glob.
If this isn't done, it's left to directory ordering which can result in indeterminent behaviour.
This commit is contained in:
parent
0747d41e76
commit
902183ac0e
1 changed files with 3 additions and 1 deletions
|
@ -176,7 +176,9 @@ class PluginLoader(object):
|
||||||
''' instantiates all plugins with the same arguments '''
|
''' instantiates all plugins with the same arguments '''
|
||||||
|
|
||||||
for i in self._get_paths():
|
for i in self._get_paths():
|
||||||
for path in glob.glob(os.path.join(i, "*.py")):
|
matches = glob.glob(os.path.join(i, "*.py"))
|
||||||
|
matches.sort()
|
||||||
|
for path in matches:
|
||||||
name, ext = os.path.splitext(os.path.basename(path))
|
name, ext = os.path.splitext(os.path.basename(path))
|
||||||
if name.startswith("_"):
|
if name.startswith("_"):
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue