commit 104fabe2fa1313dc09a3d9f1417bcb12c6a78086
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Tue Mar 18 18:38:04 2014 +0100
XmlTemplates: do not drop toplevel aliases so that python task can see them
Current implementation uses XmlTemplates to process aliases in the recipe XML
during parsing phase. This works fine for tasks written in XML itself or
xincluded. For the Python tasks this currently does not work since the task
is not being processed for aliases. This patch prevents removal of available
top-level aliases from XmlTemplates processor so that python task can access
them via ControllerAPI during the task execution.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/XmlTemplates.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/lnst/Controller/XmlTemplates.py b/lnst/Controller/XmlTemplates.py
index 1a65c8b..7572b16 100644
--- a/lnst/Controller/XmlTemplates.py
+++ b/lnst/Controller/XmlTemplates.py
@@ -336,7 +336,10 @@ class XmlTemplates:
for child in element.getchildren():
self.process_aliases(child)
- self.drop_namespace_level()
+ # do not drop alias definitions when at top-level so that python
+ # tasks are able to access them
+ if element.tag != "lnstrecipe":
+ self.drop_namespace_level()
def expand_aliases(self, string):
while True: