commit b1442e682b0a655b0c005ca7c7bc12d2db0e6712 Author: Ondrej Lichtner olichtne@redhat.com Date: Tue Apr 1 13:42:56 2014 +0200
RecipeParser: always initialize ovs_conf
When the recipe doesn't contain any vlans or bonds, the corresponding ovs_conf fields wouldn't be created. That causes the slave to crash. This commit fixes that.
Signed-off-by: Ondrej Lichtner olichtne@redhat.com Signed-off-by: Jiri Pirko jiri@resnulli.us
lnst/Controller/RecipeParser.py | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) --- diff --git a/lnst/Controller/RecipeParser.py b/lnst/Controller/RecipeParser.py index c4fe61f..2b554d7 100644 --- a/lnst/Controller/RecipeParser.py +++ b/lnst/Controller/RecipeParser.py @@ -141,8 +141,7 @@ class RecipeParser(XmlParser): iface["slaves"].append(slave)
vlan_elems = iface_tag.findall("vlan") - if len(vlan_elems) > 0: - vlans = iface["ovs_conf"]["vlans"] = XmlData(slaves_tag) + vlans = iface["ovs_conf"]["vlans"] = XmlData(slaves_tag) for vlan in vlan_elems: vlan_tag = str(self._get_attribute(vlan, "tag")) if vlan_tag in vlans: @@ -171,8 +170,7 @@ class RecipeParser(XmlParser):
bonded_slaves = {} bond_elems = iface_tag.findall("bond") - if len(bond_elems) > 0: - bonds = iface["ovs_conf"]["bonds"] = XmlData(slaves_tag) + bonds = iface["ovs_conf"]["bonds"] = XmlData(slaves_tag) for bond_tag in bond_elems: bond_id = str(self._get_attribute(bond_tag, "id")) if bond_id in bonds:
lnst-developers@lists.fedorahosted.org