From: Ondrej Lichtner olichtne@redhat.com
When recipe execution fails before slaves are fully initialized the Controller calls cleanup and attempts to call the destroy_devices method on the slaves. If this happens before the InterfaceManager is created the call would crash the lnst-slave application. This commit fixes that.
Signed-off-by: Ondrej Lichtner olichtne@redhat.com --- lnst/Slave/NetTestSlave.py | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py index 9c5486c..795ec1d 100644 --- a/lnst/Slave/NetTestSlave.py +++ b/lnst/Slave/NetTestSlave.py @@ -234,6 +234,9 @@ class SlaveMethods: return matched
def destroy_devices(self): + if self._if_manager is None: + return + devices = self._if_manager.get_devices() for dev in devices: try: