From: Ondrej Lichtner <olichtne(a)redhat.com>
Machine cleanup would sometimes end with a KeyError. This would happen
when recipe parsing failed too soon and no machines were parsed yet.
This commit fixes that.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
NetTest/NetTestController.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/NetTest/NetTestController.py b/NetTest/NetTestController.py
index 548fc17..95326e3 100644
--- a/NetTest/NetTestController.py
+++ b/NetTest/NetTestController.py
@@ -264,6 +264,8 @@ class NetTestController:
rpc.set_logging(ip_addr, self._config.get_option('log', 'port'))
def _deconfigure_slaves(self):
+ if 'machines' not in self._recipe:
+ return
for machine_id in self._recipe["machines"]:
info = self._get_machineinfo(machine_id)
if "rpc" not in info:
@@ -288,6 +290,8 @@ class NetTestController:
net["default_bridge"].cleanup()
def _disconnect_slaves(self):
+ if 'machines' not in self._recipe:
+ return
for machine_id in self._recipe["machines"]:
info = self._get_machineinfo(machine_id)
if self._remoteexec and "session" in info:
--
1.7.11.4