mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
DNS Locations: server-mod: add automatic records update
For any location or server weight change is required to update records https://fedorahosted.org/freeipa/ticket/2008 Reviewed-By: Petr Spacek <pspacek@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
@@ -418,6 +418,16 @@ class DNSUpdateNotIPAManagedZone(PublicMessage):
|
||||
)
|
||||
|
||||
|
||||
class AutomaticDNSRecordsUpdateFailed(PublicMessage):
|
||||
errno = 13024
|
||||
type = "warning"
|
||||
format = _(
|
||||
"Automatic update of DNS system records failed. "
|
||||
"Please re-run update of system records manually to get list of "
|
||||
"missing records."
|
||||
)
|
||||
|
||||
|
||||
def iter_messages(variables, base):
|
||||
"""Return a tuple with all subclasses
|
||||
"""
|
||||
|
||||
@@ -230,8 +230,13 @@ class server_mod(LDAPUpdate):
|
||||
|
||||
def post_callback(self, ldap, dn, entry_attrs, *keys, **options):
|
||||
assert isinstance(dn, DN)
|
||||
self.obj.convert_location(entry_attrs, **options)
|
||||
self.obj.get_enabled_roles(entry_attrs)
|
||||
|
||||
if 'ipalocation' or 'ipalocationweight' in entry_attrs:
|
||||
result = self.api.Command.dns_update_system_records()
|
||||
if not result.get('value'):
|
||||
self.add_message(messages.AutomaticDNSRecordsUpdateFailed())
|
||||
self.obj.convert_location(entry_attrs, **options)
|
||||
return dn
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user