summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/dns.py
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2014-09-16 12:23:21 +0200
committerPetr Viktorin <pviktori@redhat.com>2014-09-25 16:38:02 +0200
commit239adf9de40748caa9e1522c9cd04aedd5516c75 (patch)
treed8ec1caad8aa5db0d2035b900753a1f11c3a147b /ipalib/plugins/dns.py
parent7e24e241ba18dddba6cc217b1108c4874647c8de (diff)
downloadfreeipa-239adf9de40748caa9e1522c9cd04aedd5516c75.tar.gz
freeipa-239adf9de40748caa9e1522c9cd04aedd5516c75.tar.xz
freeipa-239adf9de40748caa9e1522c9cd04aedd5516c75.zip
DNS: autofill admin email
Admins email (SOA RNAME) is autofilled with value 'hostmaster'. Bind will automaticaly append zone part. Part of ticket: https://fedorahosted.org/freeipa/ticket/4149 Reviewed-By: Petr Spacek <pspacek@redhat.com>
Diffstat (limited to 'ipalib/plugins/dns.py')
-rw-r--r--ipalib/plugins/dns.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py
index 75d482001..64dc6f4bd 100644
--- a/ipalib/plugins/dns.py
+++ b/ipalib/plugins/dns.py
@@ -39,7 +39,7 @@ from ipalib.plugable import Registry
from ipalib.plugins.baseldap import *
from ipalib import _, ngettext
from ipalib import messages
-from ipalib.util import (validate_zonemgr, normalize_zonemgr,
+from ipalib.util import (normalize_zonemgr,
get_dns_forward_zone_update_policy,
get_dns_reverse_zone_update_policy,
get_reverse_zone_default, REVERSE_DNS_ZONES,
@@ -314,8 +314,8 @@ _output_permissions = (
def _rname_validator(ugettext, zonemgr):
try:
- validate_zonemgr(zonemgr)
- except (ValueError, dns.exception.SyntaxError), e:
+ DNSName(zonemgr) # test only if it is valid domain name
+ except (ValueError, dns.exception.SyntaxError) as e:
return unicode(e)
return None
@@ -2091,13 +2091,12 @@ class dnszone(DNSZoneBase):
),
DNSNameParam('idnssoarname',
_rname_validator,
- only_absolute=True,
cli_name='admin_email',
label=_('Administrator e-mail address'),
doc=_('Administrator e-mail address'),
- default_from=lambda idnsname:
- DNSName(('hostmaster')).derelativize(idnsname),
+ default=DNSName(u'hostmaster'),
normalizer=normalize_zonemgr,
+ autofill=True,
),
Int('idnssoaserial',
cli_name='serial',