From 7f52d0517cf2a0ca8815980addc75ec73ff820ce Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Mon, 31 Oct 2011 07:47:58 -0400 Subject: catch XML syntax error in xinclude routines --- src/lib/Server/Lint/Validate.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib/Server/Lint/Validate.py b/src/lib/Server/Lint/Validate.py index 19fd61d25..952a65365 100644 --- a/src/lib/Server/Lint/Validate.py +++ b/src/lib/Server/Lint/Validate.py @@ -164,7 +164,13 @@ class Validate(Bcfg2.Server.Lint.ServerlessPlugin): # listed in self.files, though, there's really nothing we can # do to guess what a file in Metadata is if rv: - rv.extend(self.follow_xinclude(rv[0])) + try: + rv.extend(self.follow_xinclude(rv[0])) + except lxml.etree.XMLSyntaxError: + e = sys.exc_info()[1] + self.LintError("xml-failed-to-parse", + "%s fails to parse:\n%s" % (rv[0], e)) + return rv -- cgit v1.2.3-1-g7c22