]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
$GENERATE was not padding correctly given a pattern like ${0,3} it was
authorBob Halley <halley@dnspython.org>
Thu, 21 Feb 2019 14:33:00 +0000 (06:33 -0800)
committerBob Halley <halley@dnspython.org>
Thu, 21 Feb 2019 14:33:00 +0000 (06:33 -0800)
using the index field (0) as the padding width, instead of the correct value
3.

dns/zone.py
tests/test_generate.py

index 5310a35858c22d11f83d119324383945350b2ccc..21731a6a840f1d9e8625247ec16901d5fc97cd43 100644 (file)
@@ -750,7 +750,6 @@ class _MasterReader(object):
             mod, sign, offset, width = g3.groups()
             if sign == '':
                 sign = '+'
-            width = g3.groups()[2]
             base = 'd'
 
         if not (g1 or g2 or g3):
index d7e5dbe01ddd58297b57b4ffabd83343f4a5b3d4..ebd73027a58e6b5135653a4fcd81e4aa5204f3f4 100644 (file)
@@ -527,11 +527,11 @@ class GenerateTestCase(unittest.TestCase):
                 dns.rdata.from_text(dns.rdataclass.IN, dns.rdatatype.MX,
                                     '0 blaz.foo')),
 
-               (dns.name.from_text('prefix-27', None), 3600,
+               (dns.name.from_text('prefix-027', None), 3600,
                 dns.rdata.from_text(dns.rdataclass.IN, dns.rdatatype.A,
                                     '10.0.0.27')),
 
-               (dns.name.from_text('prefix-28', None), 3600,
+               (dns.name.from_text('prefix-028', None), 3600,
                 dns.rdata.from_text(dns.rdataclass.IN, dns.rdatatype.A,
                                     '10.0.0.28')),