commit 7a6044a136773c267bf95988f1567039169f3070
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Wed Sep 12 09:59:12 2012 +0200
NetTestController: bugfix for machine cleanup
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 files changed, 4 insertions(+), 0 deletions(-)
---
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: