commit 6eee498372621909f5bdfd0fdb1be1b921f33f0a
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Thu Nov 8 16:17:53 2012 +0100
xmlrpc: Modifying 'hello' and adding 'bye' method
This commit adds new 'bye' method -- an equivalent to 'hello'
method.
Hello is allways sent prior to any other method from controller to
slave. The bye method will be used to indicate that no method will
follow in this controller session.
The methods are used to initialize and cleanup some internal slave
structures and caches.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
NetTest/NetTestController.py | 2 +-
NetTest/NetTestSlave.py | 7 +++++++
2 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/NetTest/NetTestController.py b/NetTest/NetTestController.py
index 903c8ad..45c4941 100644
--- a/NetTest/NetTestController.py
+++ b/NetTest/NetTestController.py
@@ -353,7 +353,7 @@ class NetTestController:
if "rpc" not in info or "configured_interfaces" not in
info:
continue
- self._rpc_call(machine_id, "clear_resource_table")
+ self._rpc_call(machine_id, "bye")
for if_id in reversed(info["configured_interfaces"]):
self._rpc_call(machine_id, 'deconfigure_interface', if_id)
diff --git a/NetTest/NetTestSlave.py b/NetTest/NetTestSlave.py
index 2d15dfa..07d2de8 100644
--- a/NetTest/NetTestSlave.py
+++ b/NetTest/NetTestSlave.py
@@ -47,8 +47,15 @@ class NetTestSlaveXMLRPC:
self._resource_table = {}
def hello(self):
+ self.clear_resource_table()
+ self._cache.del_old_entries()
return "hello"
+ def bye(self):
+ self.clear_resource_table()
+ self._cache.del_old_entries()
+ return "bye"
+
def get_new_logs(self):
buffer = Logs.get_buffer()
logs = buffer.flush()
Show replies by date