]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Fix NSEC.to_text()
authorBob Halley <halley@nominum.com>
Wed, 17 Jun 2009 14:10:59 +0000 (15:10 +0100)
committerBob Halley <halley@nominum.com>
Wed, 17 Jun 2009 14:10:59 +0000 (15:10 +0100)
dns/rdtypes/ANY/NSEC.py

index aac5dd3197d02bd0d4c43619676e68c3cf73b064..7a5dd9d44e85d45ee7f424825a757e1a59460e6a 100644 (file)
@@ -37,6 +37,7 @@ class NSEC(dns.rdata.Rdata):
 
     def to_text(self, origin=None, relativize=True, **kw):
         next = self.next.choose_relativity(origin, relativize)
+        text = ''
         for (window, bitmap) in self.windows:
             bits = []
             for i in xrange(0, len(bitmap)):
@@ -45,8 +46,8 @@ class NSEC(dns.rdata.Rdata):
                     if byte & (0x80 >> j):
                         bits.append(dns.rdatatype.to_text(window * 256 + \
                                                           i * 8 + j))
-            text = ' '.join(bits)
-        return '%s %s' % (next, text)
+            text += (' ' + ' '.join(bits))
+        return '%s%s' % (next, text)
         
     def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
         next = tok.get_name()