add XInclude support

This commit is contained in:
brent s 2019-06-03 16:30:32 -04:00
parent 76c898588f
commit eb9bbd8b3b

View File

@ -102,7 +102,9 @@ class Backup(object):
exit(1)
try:
with open(self.args['cfgfile'], 'rb') as f:
self.cfg = etree.fromstring(f.read())
self.xml = etree.parse(f)
self.xml.xinclude()
self.cfg = self.xml.getroot()
except etree.XMLSyntaxError:
self.logger.error('{0} is invalid XML'.format(self.args['cfgfile']))
raise ValueError(('{0} does not seem to be valid XML. '