From 902183ac0e718eee6f506e9cf863104f3947f15c Mon Sep 17 00:00:00 2001 From: Brian Harring Date: Mon, 19 Aug 2013 19:48:17 -0400 Subject: [PATCH] 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. --- lib/ansible/utils/plugins.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/utils/plugins.py b/lib/ansible/utils/plugins.py index 8d1ef493c3..9d2f5e3317 100644 --- a/lib/ansible/utils/plugins.py +++ b/lib/ansible/utils/plugins.py @@ -176,7 +176,9 @@ class PluginLoader(object): ''' instantiates all plugins with the same arguments ''' 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)) if name.startswith("_"): continue