rndc gives textual and exit-code feedback, use it
[zonemaker.git] / zone.py
diff --git a/zone.py b/zone.py
index b543d31c3c6d0456491519e2c21296f88b953271..d7c23ff2506858d91b648a121c4b7321676a252b 100644 (file)
--- a/zone.py
+++ b/zone.py
 # 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('.'):