summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2011-10-31 07:47:58 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2011-10-31 07:48:13 -0400
commit7f52d0517cf2a0ca8815980addc75ec73ff820ce (patch)
tree5461e43c67a65da034e57157d1ba43bfb7e8c248
parent4eacf6985d2724f85f0384b1d44ba8992bed3372 (diff)
downloadbcfg2-7f52d0517cf2a0ca8815980addc75ec73ff820ce.tar.gz
bcfg2-7f52d0517cf2a0ca8815980addc75ec73ff820ce.tar.bz2
bcfg2-7f52d0517cf2a0ca8815980addc75ec73ff820ce.zip
catch XML syntax error in xinclude routines
-rw-r--r--src/lib/Server/Lint/Validate.py8
1 files changed, 7 insertions, 1 deletions
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