diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2005-11-28 21:39:04 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2005-11-28 21:39:04 +0000 |
commit | 662ca85e183554a327fe15a6086ae6f64f927e6e (patch) | |
tree | f2b5d2e4cf30efc6f5918a9f413f0207af3aaa68 /src/lib | |
parent | 28abf230098885fb8f9202522540f3a85c61c523 (diff) | |
download | bcfg2-662ca85e183554a327fe15a6086ae6f64f927e6e.tar.gz bcfg2-662ca85e183554a327fe15a6086ae6f64f927e6e.tar.bz2 bcfg2-662ca85e183554a327fe15a6086ae6f64f927e6e.zip |
switch to XMLSyntaxError
(Logical change 1.368)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1549 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Server/Plugin.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/Server/Plugin.py b/src/lib/Server/Plugin.py index 21130a489..6a4d4b550 100644 --- a/src/lib/Server/Plugin.py +++ b/src/lib/Server/Plugin.py @@ -1,11 +1,10 @@ '''This module provides the baseclass for Bcfg2 Server Plugins''' __revision__ = '$Revision:$' -from lxml.etree import XML +from lxml.etree import XML, XMLSyntaxError from os import stat from stat import ST_MTIME from syslog import syslog, LOG_ERR, LOG_INFO -from xml.parsers.expat import ExpatError class PluginInitError(Exception): '''Error raised in cases of Plugin initialization errors''' @@ -158,7 +157,7 @@ class XMLFileBacked(FileBacked): '''Build local data structures''' try: xdata = XML(self.data) - except ExpatError: + except XMLSyntaxError: syslog(LOG_ERR, "Failed to parse %s"%(self.name)) return self.label = xdata.attrib[self.__identifier__] @@ -194,7 +193,7 @@ class ScopedXMLFile(SingleXMLFileBacked): '''Build internal data structures''' try: xdata = XML(self.data) - except ExpatError, msg: + except XMLSyntaxError, msg: syslog(LOG_ERR, "Failed to parse %s"%(self.name)) syslog(LOG_ERR, msg) return |