mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-24 16:10:02 -06:00
Add forgotten trailing dots in DNS records
583023
This commit is contained in:
parent
6e9cc2640b
commit
04182bf68f
@ -95,6 +95,13 @@ _zone_default_attributes = [
|
||||
]
|
||||
|
||||
|
||||
# normalizer for admin email
|
||||
def _rname_normalizer(value):
|
||||
value = value.replace('@', '.')
|
||||
if not value.endswith('.'):
|
||||
value += '.'
|
||||
return value
|
||||
|
||||
# build zone dn
|
||||
def _get_zone_dn(ldap, idnsname):
|
||||
rdn = ldap.make_rdn_from_attr('idnsname', idnsname)
|
||||
@ -129,7 +136,7 @@ class dns(Object):
|
||||
cli_name='admin_email',
|
||||
label=_('administrator e-mail address'),
|
||||
default_from=lambda idnsname: 'root.%s' % idnsname,
|
||||
normalizer=lambda value: value.replace('@', '.'),
|
||||
normalizer=_rname_normalizer,
|
||||
),
|
||||
Int('idnssoaserial?',
|
||||
cli_name='serial',
|
||||
|
@ -93,7 +93,7 @@ def add_zone(name, update_policy=None, dns_backup=None):
|
||||
|
||||
try:
|
||||
api.Command.dns_add(unicode(name),
|
||||
idnssoamname=unicode(api.env.host),
|
||||
idnssoamname=unicode(api.env.host+"."),
|
||||
idnsallowdynupdate=True,
|
||||
idnsupdatepolicy=unicode(update_policy))
|
||||
except (errors.DuplicateEntry, errors.EmptyModlist):
|
||||
@ -109,13 +109,13 @@ def add_reverze_zone(ip_address, update_policy=None, dns_backup=None):
|
||||
update_policy = "grant %s krb5-subdomain %s. PTR;" % (api.env.realm, zone)
|
||||
try:
|
||||
api.Command.dns_add(unicode(zone),
|
||||
idnssoamname=unicode(api.env.host),
|
||||
idnssoamname=unicode(api.env.host+"."),
|
||||
idnsallowdynupdate=True,
|
||||
idnsupdatepolicy=unicode(update_policy))
|
||||
except (errors.DuplicateEntry, errors.EmptyModlist):
|
||||
pass
|
||||
|
||||
add_rr(zone, "@", "NS", api.env.host, dns_backup)
|
||||
add_rr(zone, "@", "NS", api.env.host+".", dns_backup)
|
||||
|
||||
return zone
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user