# HG changeset patch # User Tero Marttila # Date 1424959738 -7200 # Node ID 0082d2092d1f1954e6eb1bb4eaf3789c4f2182df # Parent 530f22575889cb3d203b7de056bb9215e4b0a31f pvl.hosts.zone: should be an fqdn diff -r 530f22575889 -r 0082d2092d1f pvl/hosts/tests.py --- a/pvl/hosts/tests.py Thu Feb 26 16:05:26 2015 +0200 +++ b/pvl/hosts/tests.py Thu Feb 26 16:08:58 2015 +0200 @@ -252,8 +252,15 @@ ip = '192.0.2.3', ), ] + + rrs = zone.apply_hosts_forward(hosts, 'domain', add_origin=True) + + # handle the $ORIGIN directive + rd = next(rrs) - self.assertZoneEquals(zone.apply_hosts_forward(hosts, 'domain'), { + self.assertEquals(unicode(rd), '$ORIGIN\tdomain.') + + self.assertZoneEquals(rrs, { ('foo', 'A'): ['192.0.2.1'], ('foo', 'AAAA'): ['2001:db8::c000:201'], ('test', 'CNAME'): ['foo'], diff -r 530f22575889 -r 0082d2092d1f pvl/hosts/zone.py --- a/pvl/hosts/zone.py Thu Feb 26 16:05:26 2015 +0200 +++ b/pvl/hosts/zone.py Thu Feb 26 16:08:58 2015 +0200 @@ -132,7 +132,7 @@ """ if add_origin: - yield pvl.dns.ZoneDirective.build(None, 'ORIGIN', origin) + yield pvl.dns.ZoneDirective.build(None, 'ORIGIN', pvl.dns.fqdn(origin)) by_name = dict() by_name_type = dict()