Changeset 2037


Ignore:
Timestamp:
Jan 30, 2009, 8:38:36 PM (16 years ago)
Author:
broder
Message:

The DNS server shouldn't error if dns.zone_files isn't set in the config.

Location:
trunk/packages/invirt-dns
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-dns/debian/changelog

    r1974 r2037  
     1invirt-dns (0.0.9) unstable; urgency=low
     2
     3  * Don't error if dns.zone_files isn't set in the config.
     4
     5 -- Evan Broder <broder@mit.edu>  Fri, 30 Jan 2009 20:09:35 -0500
     6
    17invirt-dns (0.0.8) unstable; urgency=low
    28
  • trunk/packages/invirt-dns/invirt-dns

    r1974 r2037  
    88from twisted.python import failure
    99
     10from invirt.common import InvirtConfigError
    1011from invirt.config import structs as config
    1112import invirt.database
     
    170171if '__main__' == __name__:
    171172    resolvers = []
    172     for zone in config.dns.zone_files:
    173         for origin in config.dns.domains:
    174             r = QuotingBindAuthority(zone)
    175             # This sucks, but if I want a generic zone file, I have to
    176             # reload the information by hand
    177             r.origin = origin
    178             lines = open(zone).readlines()
    179             lines = r.collapseContinuations(r.stripComments(lines))
    180             r.parseLines(lines)
    181            
    182             resolvers.append(r)
     173    try:
     174        for zone in config.dns.zone_files:
     175            for origin in config.dns.domains:
     176                r = QuotingBindAuthority(zone)
     177                # This sucks, but if I want a generic zone file, I have to
     178                # reload the information by hand
     179                r.origin = origin
     180                lines = open(zone).readlines()
     181                lines = r.collapseContinuations(r.stripComments(lines))
     182                r.parseLines(lines)
     183               
     184                resolvers.append(r)
     185    except InvirtConfigError:
     186        # Don't care if zone_files isn't defined
     187        pass
    183188    resolvers.append(DatabaseAuthority())
    184189
Note: See TracChangeset for help on using the changeset viewer.