In addition to set/get methods I also added save and restore methods to the
InterfaceAPI. These two methods provide convenient interface when a user
need to restore the settings back to original state. Without it the user
will have to save the interface coalescing settings within the python task
per each interface he will be using.
An example:
cdata = iface.save_coalesce()
cdata['use_adaptive_tx_coalesce'] = 0
iface.set_coalesce(cdata)
# do the test
iface.restore_coalesce()
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Controller/Task.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/lnst/Controller/Task.py b/lnst/Controller/Task.py
index c32a950..bc7670f 100644
--- a/lnst/Controller/Task.py
+++ b/lnst/Controller/Task.py
@@ -845,6 +845,18 @@ class InterfaceAPI(object):
def mroute_del_vif(self, vif_index, table_id=None):
return self._if.mroute_del_vif(vif_index, table_id)
+ def get_coalesce(self):
+ return self._if.get_coalesce()
+
+ def set_coalesce(self, cdata):
+ return self._if.set_coalesce(cdata)
+
+ def save_coalesce(self):
+ return self._if.save_coalesce()
+
+ def restore_coalesce(self):
+ return self._if.restore_coalesce()
+
class ModuleAPI(object):
""" An API class representing a module. """
--
2.9.5