[svn] commit: r861 - /branches/each-zoneload/convert.py
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Feb 18 05:53:47 UTC 2010
Author: each
Date: Thu Feb 18 05:53:47 2010
New Revision: 861
Log:
strip key id comments from DNSKEY lines before making SQL statements
Modified:
branches/each-zoneload/convert.py
Modified: branches/each-zoneload/convert.py
==============================================================================
--- branches/each-zoneload/convert.py (original)
+++ branches/each-zoneload/convert.py Thu Feb 18 05:53:47 2010
@@ -1,5 +1,5 @@
#!/usr/bin/python3
-import sys, string
+import sys, string, re
def rname(name):
new = name.split('.')
new.reverse()
@@ -11,8 +11,13 @@
zone = sys.argv[3]
if zone[-1] != '.':
zone += '.'
+
print("INSERT INTO zones (id, name, rdclass) VALUES (%d, '%s', 'IN');" % (zone_id, zone))
+
+decomment = re.compile(' *;.*$')
+
for line in data:
+ line = decomment.sub('', line)
line = line.split()
name = line.pop(0).strip()
ttl = int(line.pop(0).strip())
More information about the bind10-changes
mailing list