summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Plugins/Base.py5
-rw-r--r--src/lib/Server/Plugins/Bundler.py7
-rw-r--r--src/lib/Server/Plugins/TCheetah.py5
3 files changed, 7 insertions, 10 deletions
diff --git a/src/lib/Server/Plugins/Base.py b/src/lib/Server/Plugins/Base.py
index 0b912cb01..71719263f 100644
--- a/src/lib/Server/Plugins/Base.py
+++ b/src/lib/Server/Plugins/Base.py
@@ -2,8 +2,7 @@
__revision__ = '$Revision$'
from copy import deepcopy
-from lxml.etree import Element, XML
-from xml.parsers.expat import ExpatError
+from lxml.etree import Element, XML, XMLSyntaxError
from Bcfg2.Server.Plugin import Plugin, PluginInitError, SingleXMLFileBacked
@@ -27,7 +26,7 @@ class Base(Plugin, SingleXMLFileBacked):
'''Store XML data in reasonable structures'''
try:
xdata = XML(self.data)
- except ExpatError:
+ except XMLSyntaxError:
self.LogError("Failed to parse base.xml")
return
self.store = {'all':[], 'Class':{'all':[]}, 'Image':{'all':[]}, 'all':[]}
diff --git a/src/lib/Server/Plugins/Bundler.py b/src/lib/Server/Plugins/Bundler.py
index c602dceb7..86c52b9e2 100644
--- a/src/lib/Server/Plugins/Bundler.py
+++ b/src/lib/Server/Plugins/Bundler.py
@@ -3,8 +3,7 @@ __revision__ = '$Revision$'
from copy import deepcopy
from syslog import LOG_ERR, syslog
-from lxml.etree import Element, XML
-from xml.parsers.expat import ExpatError
+from lxml.etree import Element, XML, XMLSyntaxError
from Bcfg2.Server.Plugin import Plugin, SingleXMLFileBacked, XMLFileBacked, DirectoryBacked
@@ -19,7 +18,7 @@ class ImageFile(SingleXMLFileBacked):
'''Build data structures out of the data'''
try:
xdata = XML(self.data)
- except ExpatError, err:
+ except XMLSyntaxError, err:
syslog(LOG_ERR, "Failed to parse file %s" % (self.name))
syslog(LOG_ERR, err)
del self.data
@@ -43,7 +42,7 @@ class Bundle(XMLFileBacked):
'''Build data structures from the source data'''
try:
xdata = XML(self.data)
- except ExpatError, err:
+ except XMLSyntaxError, err:
syslog(LOG_ERR, "Failed to parse file %s" % (self.name))
syslog(LOG_ERR, str(err))
del self.data
diff --git a/src/lib/Server/Plugins/TCheetah.py b/src/lib/Server/Plugins/TCheetah.py
index 314a5b0ac..f39ebbad0 100644
--- a/src/lib/Server/Plugins/TCheetah.py
+++ b/src/lib/Server/Plugins/TCheetah.py
@@ -4,8 +4,7 @@ __revision__ = '$Revision$'
from posixpath import isdir
from syslog import syslog, LOG_ERR
from Bcfg2.Server.Plugin import Plugin, PluginExecutionError, FileBacked, SingleXMLFileBacked
-from lxml.etree import XML
-from xml.parsers.expat import ExpatError
+from lxml.etree import XML, XMLSyntaxError
from Cheetah.Template import Template
class TemplateFile(FileBacked):
@@ -38,7 +37,7 @@ class CheetahProperties(SingleXMLFileBacked):
try:
self.properties = XML(self.data)
del self.data
- except ExpatError:
+ except XMLSyntaxError:
syslog(LOG_ERR, "TCheetah: Failed to parse properties")
class TCheetah(Plugin):