summaryrefslogtreecommitdiffstats
path: root/ipalib/util.py
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2012-02-20 13:40:13 +0100
committerMartin Kosek <mkosek@redhat.com>2012-02-20 15:34:45 +0100
commite10af0b764fb2d042c6ad730866af508f231c8cb (patch)
treeb6530905db9e78c34b9e2f4da4a8ca9ede430dc0 /ipalib/util.py
parent8ec98dfcae3daf1324bf924e1bf1684007bcf9d1 (diff)
downloadfreeipa-e10af0b764fb2d042c6ad730866af508f231c8cb.tar.gz
freeipa-e10af0b764fb2d042c6ad730866af508f231c8cb.tar.xz
freeipa-e10af0b764fb2d042c6ad730866af508f231c8cb.zip
Ease zonemgr restrictions
Admin e-mail validator currently requires an email to be in a second-level domain (hostmaster@example.com). This is too restrictive. Top level domain e-mails (hostmaster@testrelm) should also be allowed. This patch also fixes default zonemgr value in help texts and man pages. https://fedorahosted.org/freeipa/ticket/2272
Diffstat (limited to 'ipalib/util.py')
-rw-r--r--ipalib/util.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/ipalib/util.py b/ipalib/util.py
index 365dd3399..eb6702dc9 100644
--- a/ipalib/util.py
+++ b/ipalib/util.py
@@ -231,6 +231,8 @@ def validate_zonemgr(zonemgr):
local_part, dot, domain = zonemgr.partition('@')
if not regex_local_part.match(local_part):
raise ValueError(local_part_errmsg)
+ if not domain:
+ raise ValueError(_('missing address domain'))
elif zonemgr.count('@') > 1:
raise ValueError(_('too many \'@\' characters'))
else:
@@ -238,8 +240,7 @@ def validate_zonemgr(zonemgr):
if last_fake_sep != -1: # there is a 'fake' local-part/domain separator
sep = zonemgr.find('.', last_fake_sep+2)
if sep == -1:
- raise ValueError(_('address domain is not fully qualified ' \
- '("example.com" instead of just "example")'))
+ raise ValueError(_('missing address domain'))
local_part = zonemgr[:sep]
domain = zonemgr[sep+1:]
@@ -251,10 +252,6 @@ def validate_zonemgr(zonemgr):
if not regex_local_part.match(local_part):
raise ValueError(local_part_errmsg)
- if '.' not in domain:
- raise ValueError(_('address domain is not fully qualified ' \
- '("example.com" instead of just "example")'))
-
if not all(regex_domain.match(part) for part in domain.split(".")):
raise ValueError(_('domain name may only include letters, numbers, and -'))