patchset applied. Thanks!
Mon, May 12, 2014 at 03:43:30PM CEST, olichtne@redhat.com wrote:
From: Ondrej Lichtner olichtne@redhat.com
This commit separates the parsing/validation of <vlan> elements from the group of virtual devices. The main reason is to check that the element has _exactly one_ slave defined. Checking this in a different place would be problematic...
Signed-off-by: Ondrej Lichtner olichtne@redhat.com
lnst/Controller/RecipeParser.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/lnst/Controller/RecipeParser.py b/lnst/Controller/RecipeParser.py index 046d6d9..df0b47a 100644 --- a/lnst/Controller/RecipeParser.py +++ b/lnst/Controller/RecipeParser.py @@ -105,7 +105,7 @@ class RecipeParser(XmlParser):
if iface["type"] == "eth": iface["network"] = self._get_attribute(iface_tag, "label")
elif iface["type"] in ["bond", "bridge", "vlan", "macvlan", "team"]:
elif iface["type"] in ["bond", "bridge", "macvlan", "team"]: # slaves slaves_tag = iface_tag.find("slaves") if slaves_tag is not None and len(slaves_tag) > 0:@@ -127,6 +127,27 @@ class RecipeParser(XmlParser): opts = self._proces_options(opts_tag) if len(opts) > 0: iface["options"] = opts
elif iface["type"] in ["vlan"]:# real_dev of the VLAN interfaceslaves_tag = iface_tag.find("slaves")if slaves_tag is None or len(slaves_tag) != 1:msg = "VLAN '%s' need exactly one slave definition."\% iface["id"]raise RecipeError(msg, vlan)iface["slaves"] = XmlCollection(slaves_tag)slave_tag = slaves_tag[0]slave = XmlData(slave_tag)slave["id"] = self._get_attribute(slave_tag, "id")iface["slaves"].append(slave)# interface optionsopts_tag = iface_tag.find("options")opts = self._proces_options(opts_tag)if len(opts) > 0:iface["options"] = opts elif iface["type"] == "ovs_bridge": slaves_tag = iface_tag.find("slaves") iface["slaves"] = XmlCollection(slaves_tag)-- 1.9.0
LNST-developers mailing list LNST-developers@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/lnst-developers