pvl.hosts.zone: label=relative() check handles FQDNs
authorTero Marttila <tero.marttila@aalto.fi>
Thu, 26 Feb 2015 16:05:26 +0200
changeset 496 530f22575889
parent 495 629fc999cc33
child 497 0082d2092d1f
pvl.hosts.zone: label=relative() check handles FQDNs
pvl/hosts/tests.py
pvl/hosts/zone.py
--- a/pvl/hosts/tests.py	Thu Feb 26 16:02:43 2015 +0200
+++ b/pvl/hosts/tests.py	Thu Feb 26 16:05:26 2015 +0200
@@ -247,7 +247,10 @@
                 ),
                 Host.build('bar', 'domain',
                     ip      = '192.0.2.2',
-                )
+                ),
+                Host.build('quux', 'example',
+                    ip      = '192.0.2.3',
+                ),
         ]
 
         self.assertZoneEquals(zone.apply_hosts_forward(hosts, 'domain'), {
--- a/pvl/hosts/zone.py	Thu Feb 26 16:02:43 2015 +0200
+++ b/pvl/hosts/zone.py	Thu Feb 26 16:05:26 2015 +0200
@@ -11,7 +11,7 @@
     pass
 
 # TODO: generate location alias CNAMEs even if host itself is outside origin?
-def host_forward (host, origin) :
+def host_forward (host, origin):
     """
         Yield ZoneRecords for hosts within the given zone origin
     """
@@ -138,9 +138,6 @@
     by_name_type = dict()
     
     for host in hosts:
-        if not host.domain:
-            log.debug("%s: skip without domain", host)
-
         for rr in host_forward(host, origin) :
             if (rr.name, 'CNAME') in by_name_type:
                 raise HostZoneError(host, "CNAME {cname} conflict: {rr}".format(cname=by_name_type[rr.name, 'CNAME'].name, rr=rr))