[elbe-devel] [PATCH 2/2] xmlpreprocess: make use of error_log_to_strings()
Torben Hohn
torben.hohn at linutronix.de
Thu May 16 14:30:35 CEST 2019
xmlpreprocess is the point, where validation errors are first caught.
In order to display the message about <norecommend>, it is necessary
to check the validation results here too.
While at it, convert the list of strings to a single string, so that its
displayed properly.
Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
elbepack/xmlpreprocess.py | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/elbepack/xmlpreprocess.py b/elbepack/xmlpreprocess.py
index 2a20445ad..dd941d414 100644
--- a/elbepack/xmlpreprocess.py
+++ b/elbepack/xmlpreprocess.py
@@ -17,6 +17,7 @@ from lxml.etree import XMLParser, parse
from elbepack.archivedir import ArchivedirError, combinearchivedir
from elbepack.directories import elbe_exe
from elbepack.shellhelper import command_out_stderr, CommandError
+from elbepack.validate import error_log_to_strings
# list of sections that are allowed to exists multiple times before
# preprocess and that childrens are merge into one section during preprocess
@@ -116,11 +117,7 @@ def xmlpreprocess(fname, output, variants=None):
"Unknown Exception during validation\n" + str(sys.exc_info()[1]))
# We have errors, return them in string form...
- errors = []
- for err in schema.error_log:
- errors.append("%s:%d error %s" % (err.filename, err.line, err.message))
-
- raise XMLPreprocessError(errors)
+ raise XMLPreprocessError("\n".join(error_log_to_strings(schema.error_log)))
class PreprocessWrapper(object): # pylint: disable=too-few-public-methods
--
2.11.0
More information about the elbe-devel
mailing list