this attribute is set from lnst-ctl and is used in
TaskAPI match() where it stops executing
task phase in match_setup run mode
also it's used in TaskAPI breakpoint(),
because lnst will break only in config_only run_mode
and in run mode it's ignored
it was added because all run modes need to execute python
recipe for which they all use _run_python_task() and this
seemd like best approach
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Controller/NetTestController.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py
index 39e2950..3661f77 100644
--- a/lnst/Controller/NetTestController.py
+++ b/lnst/Controller/NetTestController.py
@@ -65,6 +65,8 @@ class NetTestController:
self.remove_saved_machine_config()
+ self.run_mode = "run"
+
self._machines = {}
self._network_bridges = {}
self._tasks = []
@@ -98,6 +100,9 @@ class NetTestController:
self._resource_table["module"] = self._load_test_modules(modules_dirs)
self._resource_table["tools"] = self._load_test_tools(tools_dirs)
+ def _get_run_mode(self):
+ return self.run_mode
+
def _get_machineinfo(self, machine_id):
try:
info = self._recipe["machines"][machine_id]["params"]
@@ -608,9 +613,11 @@ class NetTestController:
os.remove("/tmp/.lnst_machine_conf")
def match_setup(self):
+ self.run_mode = "match_setup"
return {"passed": True}
def config_only_recipe(self):
+ self.run_mode = "config_only"
try:
self._prepare_network(resource_sync=False)
except (KeyboardInterrupt, Exception) as exc:
--
2.4.11