pvl.hosts-dns: a little bit of logging for --reverse-zone
authorTero Marttila <terom@paivola.fi>
Tue, 17 Dec 2013 00:59:56 +0200
changeset 296 9dad6914cfe7
parent 295 8c6d4565576f
child 297 63bce6f67916
pvl.hosts-dns: a little bit of logging for --reverse-zone
bin/pvl.hosts-dns
--- a/bin/pvl.hosts-dns	Tue Dec 17 00:56:42 2013 +0200
+++ b/bin/pvl.hosts-dns	Tue Dec 17 00:59:56 2013 +0200
@@ -24,6 +24,7 @@
         elif fnmatch.fnmatch(host.domain, domain) :
             pass
         else :
+            log.debug("%s: %s out of domain: %s", host, host.domain, domain)
             continue
         
         if host.ip :
@@ -62,12 +63,18 @@
             raise ValueError("%s: unknown ip version: %s" % (prefix, prefix.version))
 
         if not ip :
+            log.debug("%s: no ip%d", host, prefix.version)
             continue
 
         if ip not in prefix :
+            log.debug("%s: %s out of prefix: %s", host, ip, prefix)
             continue
+        
+        fqdn = pvl.dns.zone.fqdn(host, host.domain)
 
-        yield ip, pvl.dns.zone.fqdn(host, host.domain)
+        log.debug("%s: ip=%s domain=%s: %s", host, ip, host.domain, fqdn)
+
+        yield ip, fqdn
  
 def process_hosts_reverse (options, hosts, prefix) :
     """