commit b329bcd1202825661173cb2aceb8d9def8c8d245 Author: Ondrej Lichtner olichtne@redhat.com Date: Mon Mar 31 13:25:41 2014 +0200
Controller: add support for ovs_conf
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@redhat.com Signed-off-by: Jiri Pirko jiri@resnulli.us
lnst/Controller/Machine.py | 10 +++++++++- lnst/Controller/NetTestController.py | 3 +++ 2 files changed, 12 insertions(+), 1 deletions(-) --- 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 40f35b3..2453042 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"]:
lnst-developers@lists.fedorahosted.org