+invirt-dns (0.0.8) unstable; urgency=low
+
+ * Check the nics table first and then the machines table so that you can
+ do DNS lookups for machines with multiple IPs.
+
+ -- Evan Broder <broder@mit.edu> Mon, 12 Jan 2009 20:51:28 -0500
+
invirt-dns (0.0.7) unstable; urgency=low
[ Yang Zhang ]
results.append(dns.RRHeader(domain, dns.SOA, dns.IN,
ttl, self.soa, auth=True))
else: # Request for a subdomain.
- value = invirt.database.Machine.query().filter_by(name=host).first()
- if value is None or not value.nics:
- return defer.fail(failure.Failure(dns.AuthoritativeDomainError(name)))
- ip = value.nics[0].ip
- if ip is None: #Deactivated?
+ value = invirt.database.NIC.query.filter_by(hostname=host).first()
+ if value:
+ ip = value.ip
+ else:
+ value = invirt.database.Machine.query().filter_by(name=host).first()
+ if value:
+ ip = value.nics[0].ip
+ else:
+ return defer.fail(failure.Failure(dns.AuthoritativeDomainError(name)))
+
+ if ip is None:
return defer.fail(failure.Failure(dns.AuthoritativeDomainError(name)))
if type in (dns.A, dns.ALL_RECORDS):