From: Ondrej Lichtner <olichtne(a)redhat.com>
This commit adds Controller support for the ovs_conf field introduced in
the previous commit. The data is now propagated into the Interface
object representing the ovs_bridge and will be sent to the slave when
the configure() method is called.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Controller/Machine.py | 10 +++++++++-
lnst/Controller/NetTestController.py | 3 +++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py
index a849e3b..e2f1d3e 100644
--- a/lnst/Controller/Machine.py
+++ b/lnst/Controller/Machine.py
@@ -393,6 +393,8 @@ class Interface(object):
self._master = None
+ self._ovs_conf = None
+
def get_id(self):
return self._id
@@ -454,6 +456,12 @@ class Interface(object):
def get_address(self, num):
return self._addresses[num].split('/')[0]
+ def set_ovs_conf(self, ovs_conf):
+ self._ovs_conf = ovs_conf
+
+ def get_ovs_conf(self):
+ return self._ovs_conf
+
def get_prefix(self, num):
try:
return self._addresses[num].split('/')[1]
@@ -465,7 +473,7 @@ class Interface(object):
"addresses": self._addresses, "slaves":
self._slaves.keys(),
"options": self._options,
"slave_options": self._slave_options,
- "master": None}
+ "master": None, "ovs_conf": self._ovs_conf}
if self._master != None:
config["master"] = self._master.get_id()
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py
index 348c064..d82785d 100644
--- a/lnst/Controller/NetTestController.py
+++ b/lnst/Controller/NetTestController.py
@@ -284,6 +284,9 @@ class NetTestController:
for opt in iface_xml_data["options"]:
iface.set_option(opt["name"], opt["value"])
+ if "ovs_conf" in iface_xml_data:
+ iface.set_ovs_conf(iface_xml_data["ovs_conf"])
+
def _prepare_tasks(self):
self._tasks = []
for task_data in self._recipe["tasks"]:
--
1.8.5.3