From: Ondrej Lichtner <olichtne(a)redhat.com>
The controller would crash if there was a non-xml file in a pool
directory, for example hidden .swp files created by vim. This patch
fixes that by ignoring all non-xml files.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Controller/SlavePool.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lnst/Controller/SlavePool.py b/lnst/Controller/SlavePool.py
index 00ee4b8..0049519 100644
--- a/lnst/Controller/SlavePool.py
+++ b/lnst/Controller/SlavePool.py
@@ -52,7 +52,9 @@ class SlavePool:
res = []
for dirent in dentries:
- res.append(self.add_file("%s/%s" % (pool_dir, dirent)))
+ m_info = self.add_file("%s/%s" % (pool_dir, dirent))
+ if m_info != None:
+ res.append(m_info)
if len(res) == 0:
logging.warn("No machines found in this directory")
--
1.9.3