mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Add tasks.systemd_daemon_reload()
systemd daemon must be reloaded after a config file is added, changed, or removed. Provide a common API endpoint in ipaplatform.tasks. Related: https://pagure.io/freeipa/issue/7860 Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
@@ -35,6 +35,7 @@ import six
|
||||
|
||||
from ipapython import ipautil
|
||||
from ipaplatform.paths import paths
|
||||
from ipaplatform.tasks import tasks
|
||||
|
||||
# pylint: disable=no-name-in-module, import-error
|
||||
if six.PY3:
|
||||
@@ -452,7 +453,7 @@ class SystemdService(PlatformService):
|
||||
# Link exists and it is broken, make new one
|
||||
os.unlink(srv_lnk)
|
||||
os.symlink(self.lib_path, srv_lnk)
|
||||
ipautil.run([paths.SYSTEMCTL, "--system", "daemon-reload"])
|
||||
tasks.systemd_daemon_reload()
|
||||
except Exception:
|
||||
pass
|
||||
else:
|
||||
@@ -475,7 +476,7 @@ class SystemdService(PlatformService):
|
||||
if os.path.isdir(srv_tgt):
|
||||
if os.path.islink(srv_lnk):
|
||||
os.unlink(srv_lnk)
|
||||
ipautil.run([paths.SYSTEMCTL, "--system", "daemon-reload"])
|
||||
tasks.systemd_daemon_reload()
|
||||
except Exception:
|
||||
pass
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user