This method transforms dictionary items into key=value pairs that are used in ovs syntax.
Signed-off-by: Jan Tluka jtluka@redhat.com --- lnst/Devices/OvsBridgeDevice.py | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/lnst/Devices/OvsBridgeDevice.py b/lnst/Devices/OvsBridgeDevice.py index 7e5bf0c4..044b5411 100644 --- a/lnst/Devices/OvsBridgeDevice.py +++ b/lnst/Devices/OvsBridgeDevice.py @@ -35,6 +35,13 @@ class OvsBridgeDevice(SoftDevice): def destroy(self): exec_cmd("ovs-vsctl del-br %s" % self.name)
+ def _dict_to_keyvalues(self, options): + opts = "" + for opt_name, opt_value in options.items(): + opts += " %s=%s" % (opt_name, opt_value) + + return opts + def port_add(self, dev, **kwargs): options = "" for opt_name, opt_value in kwargs.items():