From 15cde2cce42ad0d50bf530f3271a68577b3925b9 Mon Sep 17 00:00:00 2001 From: Nikolai Kristiansen Date: Tue, 3 Nov 2015 11:02:19 +0100 Subject: [PATCH] Fixes broken zone-file when Domain.domain_ip6addr is empty --- mdb/management/commands/zone-sync.py | 2 +- mdb/models.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mdb/management/commands/zone-sync.py b/mdb/management/commands/zone-sync.py index bc3a838..29b39c4 100644 --- a/mdb/management/commands/zone-sync.py +++ b/mdb/management/commands/zone-sync.py @@ -46,7 +46,7 @@ class Command(BaseCommand): # do the binaries exist? for f in (self.checkzone_bin, self.bind_bin): - if not os.path.isfile(f): + if not os.path.isfile(f) and not debug: print("ERROR: no such file %s, exiting..." % f) if not debug: sys.exit(1) diff --git a/mdb/models.py b/mdb/models.py index 969b530..eb3f3f1 100644 --- a/mdb/models.py +++ b/mdb/models.py @@ -93,7 +93,7 @@ class Domain(models.Model): if self.domain_ipaddr is not None: content += "@\tIN\tA\t%s\n" % self.domain_ipaddr - if self.domain_ip6addr is not None: + if self.domain_ip6addr: content += "@\tIN\tAAAA\t%s\n" % self.domain_ip6addr content += "; SRV records\n"