projects
/
zonemaker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use exceptions rather than assertions
[zonemaker.git]
/
zonemaker
/
zone.py
diff --git
a/zonemaker/zone.py
b/zonemaker/zone.py
index 8e87f6e1ab2d1e7131546cce9ec56abf38fd4aa9..435b0392669fcaea56b6039c5c4a45f80becf705 100644
(file)
--- a/
zonemaker/zone.py
+++ b/
zonemaker/zone.py
@@
-48,9
+48,9
@@
class Zone:
NX_TTL = None, A_TTL = None, other_TTL = None,
domains = []):
self._name = hostname(name)
NX_TTL = None, A_TTL = None, other_TTL = None,
domains = []):
self._name = hostname(name)
- assert mail.endswith('.'), "Mail must be absolute, end with a dot"
+ if not mail.endswith('.'): raise Exception("Mail must be absolute, end with a dot")
atpos = mail.find('@')
atpos = mail.find('@')
- assert atpos >= 0 and atpos < mail.find('.'), "Mail must contain an @ before the first dot"
+ if atpos < 0 or atpos > mail.find('.'): raise Exception("Mail must contain an @ before the first dot")
self._mail = hostname(mail.replace('@', '.', 1))
self._NS = list(map(hostname, NS))
self._mail = hostname(mail.replace('@', '.', 1))
self._NS = list(map(hostname, NS))