projects
/
zonemaker.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
45fc321
)
use exceptions rather than assertions
author
Ralf Jung
<post@ralfj.de>
Sat, 8 Nov 2014 21:47:54 +0000
(22:47 +0100)
committer
Ralf Jung
<post@ralfj.de>
Sat, 8 Nov 2014 21:47:54 +0000
(22:47 +0100)
zonemaker/zone.py
patch
|
blob
|
history
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))