Changeset 226


Ignore:
Timestamp:
Oct 28, 2007, 11:16:12 PM (17 years ago)
Author:
ecprice
Message:

Use the machine name, not the hostname, field.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns/dnsserver.py

    r181 r226  
    3131        if cls == dns.IN and type in (dns.A, dns.ALL_RECORDS):
    3232            host = name[:-len(self.domain)-1]
    33             value = sipb_xen_database.NIC.get_by(hostname=host)
    34             if value is None:
     33            value = sipb_xen_database.Machine.get_by(name=host)
     34            if value is None or not value.nics:
    3535                return defer.fail(failure.Failure(dns.AuthoritativeDomainError(name)))
    36             ip = value.ip
     36            ip = value.nics[0].ip
    3737            if ip is None:  #Deactivated?
    3838                return defer.fail(failure.Failure(dns.AuthoritativeDomainError(name)))
Note: See TracChangeset for help on using the changeset viewer.