From 2b3d6d4545619387c1920fc5488a92e908441662 Mon Sep 17 00:00:00 2001 From: Bowe Strickland Date: Wed, 23 Jan 2013 13:55:12 -0500 Subject: [PATCH] protect PluginLoader._extra_dirs from appending None MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PluginLoader.add_directory() can receive None from, for example,  Inventory.add_directory(self.basedir()) if host_list is a custom list. None has no reasonable interpretation other than ignore it. --- lib/ansible/utils/plugins.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/utils/plugins.py b/lib/ansible/utils/plugins.py index 3a6d9947a9..2af819b181 100644 --- a/lib/ansible/utils/plugins.py +++ b/lib/ansible/utils/plugins.py @@ -70,7 +70,8 @@ class PluginLoader(object): def add_directory(self, directory): """Adds an additional directory to the search path""" - self._extra_dirs.append(directory) + if directory is not None: + self._extra_dirs.append(directory) def print_paths(self): """Returns a string suitable for printing of the search path"""