X-Git-Url: https://git.ralfj.de/zonemaker.git/blobdiff_plain/75353227531611c4eb6fdd12ee95a1e8eb1e96f5..684fde7097441fab5cdb52265cfc8a43675af476:/zone.py diff --git a/zone.py b/zone.py index b543d31..d7c23ff 100644 --- a/zone.py +++ b/zone.py @@ -20,10 +20,6 @@ # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# The views and conclusions contained in the software and documentation are those -# of the authors and should not be interpreted as representing official policies, -# either expressed or implied, of the FreeBSD Project. import re, datetime #from typing import * @@ -264,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('.'):