git.samba.org
/
third_party
/
dnspython
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f22dab8
)
deal with relative names in _wire_cmp
author
Bob Halley
<halley@nominum.com>
Thu, 24 Mar 2011 17:32:23 +0000
(17:32 +0000)
committer
Bob Halley
<halley@nominum.com>
Thu, 24 Mar 2011 17:32:23 +0000
(17:32 +0000)
dns/rdata.py
patch
|
blob
|
history
diff --git
a/dns/rdata.py
b/dns/rdata.py
index b4b92515f17864b74cfa9131ea032dacdc9ee92b..98f504751df5c7fbcd3f092965858ee9a588e494 100644
(file)
--- a/
dns/rdata.py
+++ b/
dns/rdata.py
@@
-259,10
+259,14
@@
class Rdata(object):
def _wire_cmp(self, other):
# A number of types compare rdata in wire form, so we provide
# the method here instead of duplicating it.
def _wire_cmp(self, other):
# A number of types compare rdata in wire form, so we provide
# the method here instead of duplicating it.
+ #
+ # We specifiy an arbitrary origin of '.' when doing the
+ # comparison, since the rdata may have relative names and we
+ # can't convert a relative name to wire without an origin.
b1 = cStringIO.StringIO()
b1 = cStringIO.StringIO()
- self.to_wire(b1)
+ self.to_wire(b1
, None, dns.name.root
)
b2 = cStringIO.StringIO()
b2 = cStringIO.StringIO()
- other.to_wire(b2)
+ other.to_wire(b2
, None, dns.name.root
)
return cmp(b1.getvalue(), b2.getvalue())
def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
return cmp(b1.getvalue(), b2.getvalue())
def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):