commit 650c34dace8b55a283dea837e782b0b5d1be3d70
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Wed Sep 4 11:08:13 2013 +0200
RecipeParser: Support comments in tasks
There is the bug in the way the <task> tags were processed. The
processor didn't ignore comments and considered them to be invalid
commands.
This commit fixes that.
Reported-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/RecipeParser.py | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/lnst/Controller/RecipeParser.py b/lnst/Controller/RecipeParser.py
index 9bebe8c..9311b4a 100644
--- a/lnst/Controller/RecipeParser.py
+++ b/lnst/Controller/RecipeParser.py
@@ -14,6 +14,7 @@ import logging
import os
import re
import sys
+from lxml import etree
from lnst.Common.Config import lnst_config
from lnst.Common.NetUtils import normalize_hwaddr
from lnst.Common.Utils import bool_it
@@ -157,6 +158,10 @@ class RecipeParser(XmlParser):
if len(task_tag) > 0:
task["commands"] = XmlCollection(task_tag)
for cmd_tag in task_tag:
+ # Ignore comments
+ if cmd_tag.tag is etree.Comment:
+ continue
+
if cmd_tag.tag == "run":
cmd = self._process_run_cmd(cmd_tag)
elif cmd_tag.tag == "config":
Show replies by thread