bin/pvl.hosts-import
changeset 279 1b72f1e0cdbe
parent 275 4dc5cc30a278
child 280 8118854bfa6f
--- a/bin/pvl.hosts-import	Mon Dec 16 20:21:30 2013 +0200
+++ b/bin/pvl.hosts-import	Mon Dec 16 20:25:32 2013 +0200
@@ -91,7 +91,10 @@
         Yield host info from zonefile records.
     """
 
-    for rr in pvl.dns.zone.ZoneRecord.load(file) :
+    for rr in pvl.dns.zone.ZoneRecord.load(file,
+            # generated hosts need to imported by hand...
+            expand_generate = False,
+    ) :
         if options.zone_unused and rr.name == options.zone_unused :
             log.debug("%s: skip %s", rr.name, rr)
             continue
@@ -221,10 +224,12 @@
 
         if match :
             matches = match.groupdict()
+
+            log.info("%s: matched comment: %s", hostname, comment)
             break
     else :
         if options.zone_comments_default :
-            log.warn("%s: default comment: %s", hostname, comment)
+            log.info("%s: default comment: %s", hostname, comment)
             matches = { options.zone_comments_default: comment }
         else :
             log.warn("%s: unknown comment: %s", hostname, comment)
@@ -327,7 +332,7 @@
         yield 'comment-owner', comment
         yield 'owner', owner,
 
-    else :
+    elif 'group' in info or 'owner' in info :
         log.warn("%s: unknown owner: %s", host, info)
         yield 'comment-owner', "{group} / {owner}".format(
                 group   = info.get('group', ''),