From 8de2c88bc911ba9fe5bc43e003880ddb1e8972b4 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Fri, 30 Jan 2009 20:38:36 -0500 Subject: [PATCH] The DNS server shouldn't error if dns.zone_files isn't set in the config. svn path=/trunk/packages/invirt-dns/; revision=2037 --- debian/changelog | 6 ++++++ invirt-dns | 27 ++++++++++++++++----------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5677ef4..ccf1352 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +invirt-dns (0.0.9) unstable; urgency=low + + * Don't error if dns.zone_files isn't set in the config. + + -- Evan Broder Fri, 30 Jan 2009 20:09:35 -0500 + invirt-dns (0.0.8) unstable; urgency=low * Check the nics table first and then the machines table so that you can diff --git a/invirt-dns b/invirt-dns index 4049257..24117f0 100755 --- a/invirt-dns +++ b/invirt-dns @@ -7,6 +7,7 @@ from twisted.names import authority from twisted.internet import defer from twisted.python import failure +from invirt.common import InvirtConfigError from invirt.config import structs as config import invirt.database import psycopg2 @@ -169,17 +170,21 @@ class QuotingBindAuthority(authority.BindAuthority): if '__main__' == __name__: resolvers = [] - for zone in config.dns.zone_files: - for origin in config.dns.domains: - r = QuotingBindAuthority(zone) - # This sucks, but if I want a generic zone file, I have to - # reload the information by hand - r.origin = origin - lines = open(zone).readlines() - lines = r.collapseContinuations(r.stripComments(lines)) - r.parseLines(lines) - - resolvers.append(r) + try: + for zone in config.dns.zone_files: + for origin in config.dns.domains: + r = QuotingBindAuthority(zone) + # This sucks, but if I want a generic zone file, I have to + # reload the information by hand + r.origin = origin + lines = open(zone).readlines() + lines = r.collapseContinuations(r.stripComments(lines)) + r.parseLines(lines) + + resolvers.append(r) + except InvirtConfigError: + # Don't care if zone_files isn't defined + pass resolvers.append(DatabaseAuthority()) verbosity = 0 -- 1.7.9.5