From: Ondrej Lichtner <olichtne(a)redhat.com>
This commit ensures that virtual devices are cleaned up even when the
slave connection was lost. They won't be cleaned up when the deconfigure
parameter is set to false - this happens when lnst-ctl is run with
config_only.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Controller/Machine.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py
index 6a870ef..b104966 100644
--- a/lnst/Controller/Machine.py
+++ b/lnst/Controller/Machine.py
@@ -158,6 +158,11 @@ class Machine(object):
#connection to the slave was closed
if not self._msg_dispatcher.get_connection(self._id):
+ #we still need to remove virtual interfaces
+ if deconfigure:
+ for iface in reversed(self._interfaces):
+ if isinstance(iface, VirtualInterface):
+ iface.cleanup()
return
self._rpc_call("kill_cmds")
--
1.8.3.1