diff --git a/ipalib/messages.py b/ipalib/messages.py index a81cc664c..cae9d7867 100644 --- a/ipalib/messages.py +++ b/ipalib/messages.py @@ -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 """ diff --git a/ipaserver/plugins/server.py b/ipaserver/plugins/server.py index edbd3bb78..3b58c6b2f 100644 --- a/ipaserver/plugins/server.py +++ b/ipaserver/plugins/server.py @@ -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