pvl.hosts-import: separate ip6 field
authorTero Marttila <terom@paivola.fi>
Mon, 16 Dec 2013 20:49:14 +0200
changeset 281 b236f689ba22
parent 280 8118854bfa6f
child 282 63135113fe01
pvl.hosts-import: separate ip6 field
bin/pvl.hosts-import
--- a/bin/pvl.hosts-import	Mon Dec 16 20:32:16 2013 +0200
+++ b/bin/pvl.hosts-import	Mon Dec 16 20:49:14 2013 +0200
@@ -105,7 +105,9 @@
         elif rr.type in ('A', 'AAAA') :
             ip, = rr.data
 
-            yield rr.name, 'ip', ipaddr.IPAddress(ip)
+            type = { 'A': 'ip', 'AAAA': 'ip6' }[rr.type]
+
+            yield rr.name, type, ipaddr.IPAddress(ip)
 
             if rr.comment :
                 yield rr.name, 'comment', rr.comment
@@ -459,6 +461,7 @@
         
         for field, fmt in (
                 ('ip',              None),
+                ('ip6',             None),
                 ('ethernet',        None),
                 ('owner',           u"\t{field:15} = {value} # {fields[comment-owner][0]}"),
                 ('alias',           None),