diff options
author | Martin Basti <mbasti@redhat.com> | 2016-06-15 16:22:26 +0200 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2016-06-17 18:05:03 +0200 |
commit | 1997733cdf60bbd5fee8a5286d567580fa4e0198 (patch) | |
tree | 8c8bd79775728d0fd189e3e2f329089613128af2 | |
parent | ef12cad30b3fc867b3b09abe6521c168dbc3ceaf (diff) | |
download | freeipa-1997733cdf60bbd5fee8a5286d567580fa4e0198.tar.gz freeipa-1997733cdf60bbd5fee8a5286d567580fa4e0198.tar.xz freeipa-1997733cdf60bbd5fee8a5286d567580fa4e0198.zip |
DNS Locations: require to restart named-pkcs11 affter location change
Send a warning message that named-pkcs11 service must be restarted after
changes related to locations or server weight
https://fedorahosted.org/freeipa/ticket/2008
Reviewed-By: Petr Spacek <pspacek@redhat.com>
-rw-r--r-- | ipalib/messages.py | 9 | ||||
-rw-r--r-- | ipaserver/plugins/server.py | 7 |
2 files changed, 15 insertions, 1 deletions
diff --git a/ipalib/messages.py b/ipalib/messages.py index cae9d7867..0f1dc63f2 100644 --- a/ipalib/messages.py +++ b/ipalib/messages.py @@ -428,6 +428,15 @@ class AutomaticDNSRecordsUpdateFailed(PublicMessage): ) +class ServiceRestartRequired(PublicMessage): + errno = 13025 + type = "warning" + format = _( + "Service %(service)s requires restart on IPA server %(server)s to " + "apply configuration changes." + ) + + def iter_messages(variables, base): """Return a tuple with all subclasses """ diff --git a/ipaserver/plugins/server.py b/ipaserver/plugins/server.py index a39d26885..956e7e5e6 100644 --- a/ipaserver/plugins/server.py +++ b/ipaserver/plugins/server.py @@ -18,6 +18,7 @@ from .baseldap import ( from ipalib.request import context from ipalib import _, ngettext from ipalib import output +from ipaplatform import services from ipapython.dn import DN from ipapython.dnsutil import DNSName from ipaserver.servroles import ENABLED @@ -252,7 +253,11 @@ class server_mod(LDAPUpdate): # server is not DNS server pass - if 'ipalocation' or 'ipalocationweight' in entry_attrs: + if 'ipalocation_location' or 'ipalocationweight' in options: + self.add_message(messages.ServiceRestartRequired( + service=services.service('named').systemd_name, + server=keys[0], )) + result = self.api.Command.dns_update_system_records() if not result.get('value'): self.add_message(messages.AutomaticDNSRecordsUpdateFailed()) |