From: Ondrej Lichtner <olichtne(a)redhat.com>
There's no need to check pools and their availability if the recipe
doesn't get parsed. This patch moves the creation of the SlavePool
object to after the recipe is parsed.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Controller/NetTestController.py | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py
index 641d47a..71ccc32 100644
--- a/lnst/Controller/NetTestController.py
+++ b/lnst/Controller/NetTestController.py
@@ -66,10 +66,6 @@ class NetTestController:
self.remove_saved_machine_config()
- sp = SlavePool(lnst_config.get_option('environment',
'pool_dirs'),
- pool_checks)
- self._slave_pool = sp
-
self._machines = {}
self._network_bridges = {}
self._tasks = []
@@ -81,6 +77,9 @@ class NetTestController:
self._parser.set_aliases(defined_aliases, overriden_aliases)
self._recipe = self._parser.parse()
+ sp = SlavePool(lnst_config.get_pools(), pool_checks)
+ self._slave_pool = sp
+
mreq = self._get_machine_requirements()
sp.set_machine_requirements(mreq)
--
2.6.4