From 3908d50b03f7036267848b2cab228cf69d0094a9 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sun, 28 Sep 2014 12:09:53 -0400 Subject: [PATCH] Tolerate no module search path. --- lib/ansible/utils/plugins.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/ansible/utils/plugins.py b/lib/ansible/utils/plugins.py index 9349f133c4..816bf19c69 100644 --- a/lib/ansible/utils/plugins.py +++ b/lib/ansible/utils/plugins.py @@ -126,15 +126,16 @@ class PluginLoader(object): 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: - path = os.path.realpath(os.path.expanduser(path)) - contents = glob.glob("%s/*" % path) - for c in contents: - if os.path.isdir(c) and c not in ret: - ret.append(c) - if path not in ret: - ret.append(path) + if self.config is not None: + configured_paths = self.config.split(os.pathsep) + for path in configured_paths: + path = os.path.realpath(os.path.expanduser(path)) + contents = glob.glob("%s/*" % path) + for c in contents: + if os.path.isdir(c) and c not in ret: + ret.append(c) + if path not in ret: + ret.append(path) # look for any plugins installed in the package subtree ret.extend(self._get_package_paths())