commit 8d111e3644b07b57ca1bf202f12dd67a41ba765a
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Fri Feb 14 11:34:54 2014 +0100
NetTestSlave: fix cleanup
This commit removes the state variable _ctl_clean_exit. The original
idea was to use this variable to differentiate between the config_only
controller run from a controller crash/disconnection. However this posed
more problems than it solved so now the slave will simply do a complete
machine cleanup every time the "hello" method is called or when the
slave is terminated.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Slave/NetTestSlave.py | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py
index a436f9f..52679ee 100644
--- a/lnst/Slave/NetTestSlave.py
+++ b/lnst/Slave/NetTestSlave.py
@@ -61,18 +61,13 @@ class SlaveMethods:
self._resource_table = {}
- self._ctl_clean_exit = True
-
def hello(self, recipe_path):
- if not self._ctl_clean_exit:
- self.machine_cleanup()
- self._ctl_clean_exit = True
+ self.machine_cleanup()
logging.info("Recieved a controller connection.")
self.clear_resource_table()
self._cache.del_old_entries()
self.reset_file_transfers()
- self._ctl_clean_exit = False
date = datetime.datetime.now().strftime("%Y-%m-%d_%H:%M:%S")
self._log_ctl.set_recipe(recipe_path, expand=date)
@@ -94,8 +89,6 @@ class SlaveMethods:
self._cache.del_old_entries()
self.reset_file_transfers()
self._remove_capture_files()
- self._if_manager.clear_if_mapping()
- self._ctl_clean_exit = True
return "bye"
def kill_cmds(self):
@@ -263,6 +256,7 @@ class SlaveMethods:
self._if_manager.clear_if_mapping()
self._cache.del_old_entries()
self.restore_system_config()
+ self._remove_capture_files()
return True
def clear_resource_table(self):
Show replies by date