For PyRecipe network definition, the syntax is the same as it was
for Python tasks, eg. when network is defined in file network.py,
network tag in XML recipe will look like this:
<network python="network.py" />
RecipeParser will check if network is defined with python attribute,
and returns path to the file in recipe["network"] variable.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Controller/RecipeParser.py | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/lnst/Controller/RecipeParser.py b/lnst/Controller/RecipeParser.py
index 827279f..d1a9e74 100644
--- a/lnst/Controller/RecipeParser.py
+++ b/lnst/Controller/RecipeParser.py
@@ -29,10 +29,14 @@ class RecipeParser(XmlParser):
# machines
machines_tag = lnst_recipe.find("network")
- if machines_tag is not None:
- machines = recipe["machines"] = XmlCollection(machines_tag)
- for machine_tag in machines_tag:
- machines.append(self._process_machine(machine_tag))
+
+ if self._has_attribute(machines_tag, "python"):
+ recipe["network"] = self._get_attribute(machines_tag,
"python")
+ else:
+ if machines_tag is not None:
+ machines = recipe["machines"] = XmlCollection(machines_tag)
+ for machine_tag in machines_tag:
+ machines.append(self._process_machine(machine_tag))
# tasks
tasks = recipe["tasks"] = XmlCollection()
--
2.4.3