From: Ondrej Lichtner <olichtne(a)redhat.com>
Opposite action to the start_recipe method - when the recipe test method
is finished and the machine is cleaned up, the Machine instance
shouldn't use the Recipe instance for anything anymore (adding results
or logging anything).
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Controller/Controller.py | 1 +
lnst/Controller/Machine.py | 3 +++
2 files changed, 4 insertions(+)
diff --git a/lnst/Controller/Controller.py b/lnst/Controller/Controller.py
index 1166c8b..ace0caf 100644
--- a/lnst/Controller/Controller.py
+++ b/lnst/Controller/Controller.py
@@ -181,6 +181,7 @@ def _cleanup_slaves(self):
#TODO report errors during deconfiguration as FAIL!!
log_exc_traceback()
finally:
+ machine.stop_recipe()
for dev in list(machine._device_database.values()):
if isinstance(dev, VirtualDevice):
dev._destroy()
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py
index 25cdf03..59f402b 100644
--- a/lnst/Controller/Machine.py
+++ b/lnst/Controller/Machine.py
@@ -260,6 +260,9 @@ def start_recipe(self, recipe):
recipe_name = recipe.__class__.__name__
self.rpc_call("start_recipe", recipe_name)
+ def stop_recipe(self):
+ self._recipe = None
+
def _send_device_classes(self):
for cls_name, cls in device_classes:
self.send_class(cls)
--
2.21.0