52 yield pvl.dns.ZoneRecord.CNAME(pvl.dns.relative(origin, location_domain, location_alias), label) |
52 yield pvl.dns.ZoneRecord.CNAME(pvl.dns.relative(origin, location_domain, location_alias), label) |
53 except ValueError as error: |
53 except ValueError as error: |
54 raise HostZoneError(host, error) |
54 raise HostZoneError(host, error) |
55 |
55 |
56 for alias in host.alias: |
56 for alias in host.alias: |
57 try: |
57 yield pvl.dns.ZoneRecord.CNAME(pvl.dns.relative(origin, host.domain, alias), label) |
58 yield pvl.dns.ZoneRecord.CNAME(pvl.dns.relative(origin, host.domain, alias), label) |
|
59 except ValueError as error: |
|
60 raise HostZoneError(host, error) |
|
61 |
58 |
62 for alias in host.alias4: |
59 for alias in host.alias4: |
63 if not host.ip: |
60 if not host.ip: |
64 raise HostZoneError(host, "alias4={host.alias4} without ip=".format(host=host)) |
61 raise HostZoneError(host, "alias4={host.alias4} without ip=".format(host=host)) |
65 |
62 |
66 try: |
63 yield pvl.dns.ZoneRecord.A(pvl.dns.relative(origin, host.domain, alias), host.ip) |
67 yield pvl.dns.ZoneRecord.A(pvl.dns.relative(origin, host.domain, alias), host.ip) |
|
68 except ValueError as error: |
|
69 raise HostZoneError(host, error) |
|
70 |
64 |
71 for alias in host.alias6: |
65 for alias in host.alias6: |
72 if not host.ip6: |
66 if not host.ip6: |
73 raise HostZoneError(host, "alias6={host.alias6} without ip6=".format(host=host)) |
67 raise HostZoneError(host, "alias6={host.alias6} without ip6=".format(host=host)) |
74 |
68 |
75 try: |
69 yield pvl.dns.ZoneRecord.AAAA(pvl.dns.relative(origin, host.domain, alias), host.ip6) |
76 yield pvl.dns.ZoneRecord.AAAA(pvl.dns.relative(origin, host.domain, alias), host.ip6) |
|
77 except ValueError as error: |
|
78 raise HostZoneError(host, error) |
|
79 |
70 |
80 def host_reverse (host, prefix) : |
71 def host_reverse (host, prefix) : |
81 """ |
72 """ |
82 Yield (ipaddr.IPAddress, ZoneRecord) tuples for host within given prefix's reverse-dns zone. |
73 Yield (ipaddr.IPAddress, ZoneRecord) tuples for host within given prefix's reverse-dns zone. |
83 """ |
74 """ |