git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9001b79
)
Replaced InvalidRSpec with InvalidXML
author
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Fri, 21 Oct 2011 16:34:59 +0000
(12:34 -0400)
committer
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Fri, 21 Oct 2011 16:34:59 +0000
(12:34 -0400)
sfa/util/xml.py
patch
|
blob
|
history
diff --git
a/sfa/util/xml.py
b/sfa/util/xml.py
index
ac6526c
..
5a2656c
100755
(executable)
--- a/
sfa/util/xml.py
+++ b/
sfa/util/xml.py
@@
-4,7
+4,7
@@
from StringIO import StringIO
from datetime import datetime, timedelta
from sfa.util.xrn import *
from sfa.util.plxrn import hostname_to_urn
from datetime import datetime, timedelta
from sfa.util.xrn import *
from sfa.util.plxrn import hostname_to_urn
-from sfa.util.faults import SfaNotImplemented, Invalid
RSpec, InvalidRSpecElement
+from sfa.util.faults import SfaNotImplemented, Invalid
XML
class XpathFilter:
@staticmethod
class XpathFilter:
@staticmethod
@@
-52,7
+52,7
@@
class XML:
try:
tree = etree.parse(StringIO(xml), parser)
except Exception, e:
try:
tree = etree.parse(StringIO(xml), parser)
except Exception, e:
- raise Invalid
RSpec
(str(e))
+ raise Invalid
XML
(str(e))
self.root = tree.getroot()
# set namespaces map
self.namespaces = dict(self.root.nsmap)
self.root = tree.getroot()
# set namespaces map
self.namespaces = dict(self.root.nsmap)
@@
-82,7
+82,7
@@
class XML:
if not relaxng(self.root):
error = relaxng.error_log.last_error
message = "%s (line %s)" % (error.message, error.line)
if not relaxng(self.root):
error = relaxng.error_log.last_error
message = "%s (line %s)" % (error.message, error.line)
- raise Invalid
RSpec
(message)
+ raise Invalid
XML
(message)
return True
def xpath(self, xpath, namespaces=None):
return True
def xpath(self, xpath, namespaces=None):