From: Eric Price Date: Mon, 29 Oct 2007 03:16:12 +0000 (-0400) Subject: Use the machine name, not the hostname, field. X-Git-Tag: sipb-xen-dns/1~10^2 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-dns.git/commitdiff_plain/be4e6cb2c23f3973bd166d3c844ec78a41d0738a Use the machine name, not the hostname, field. svn path=/trunk/dns/; revision=226 --- diff --git a/dnsserver.py b/dnsserver.py index c2069df..3cc8dc5 100644 --- a/dnsserver.py +++ b/dnsserver.py @@ -30,10 +30,10 @@ class DatabaseAuthority(common.ResolverBase): results = [] if cls == dns.IN and type in (dns.A, dns.ALL_RECORDS): host = name[:-len(self.domain)-1] - value = sipb_xen_database.NIC.get_by(hostname=host) - if value is None: + value = sipb_xen_database.Machine.get_by(name=host) + if value is None or not value.nics: return defer.fail(failure.Failure(dns.AuthoritativeDomainError(name))) - ip = value.ip + ip = value.nics[0].ip if ip is None: #Deactivated? return defer.fail(failure.Failure(dns.AuthoritativeDomainError(name))) ttl = 900