commit 44c1b5b967a6006bdc86bc20267eb947856292d9
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Thu Jul 17 15:11:41 2014 +0200
SlavePool: ignore non-xml files in pools
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>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/SlavePool.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
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")
Show replies by thread