From: Ralf Jung Date: Thu, 1 Jan 2015 13:19:01 +0000 (+0100) Subject: forbid empty domain names X-Git-Url: https://git.ralfj.de/zonemaker.git/commitdiff_plain/cb274ac18d094a7f862335464b29d8816f26eeef?hp=89b30ae255a1fd87ef1ca4d4eadc73697bbf75c7 forbid empty domain names --- diff --git a/zone.py b/zone.py index cc4bd2b..d7c23ff 100644 --- a/zone.py +++ b/zone.py @@ -260,6 +260,8 @@ class Zone: return column_widths((self.abs_hostname(owner), time(self.getTTL(recordType)), recordType, data), (32, 8, 8)) def abs_hostname(self, name): + if name == '': + raise Exception("Empty domain name is not valid") if name == '.' or name == '@': return self._name if name.endswith('.'):