fixed matcher bug introduced with stanza matching

This commit is contained in:
Nathan Fritz 2010-01-15 21:36:53 -08:00
parent e39a2395d7
commit 7a9a86af3d
2 changed files with 4 additions and 2 deletions

View file

@ -16,6 +16,7 @@ class MatchXMLMask(base.MatcherBase):
self.default_ns = ns self.default_ns = ns
def match(self, xml): def match(self, xml):
if hasattr(xml, 'xml'):
xml = xml.xml xml = xml.xml
return self.maskcmp(xml, self._criteria, True) return self.maskcmp(xml, self._criteria, True)

View file

@ -6,6 +6,7 @@ ignore_ns = False
class MatchXPath(base.MatcherBase): class MatchXPath(base.MatcherBase):
def match(self, xml): def match(self, xml):
if hasattr(xml, 'xml'):
xml = xml.xml xml = xml.xml
x = cElementTree.Element('x') x = cElementTree.Element('x')
x.append(xml) x.append(xml)