From 8d120b9af4966d1d8cd49e4900b3de6149700b4e Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 12 May 2022 17:48:15 +0200 Subject: vrrp: T3944: use "reload-or-restart" over individual code paths systemd has its internal reload or restart logic - we do not need to programm it on our own. --- src/conf_mode/high-availability.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/conf_mode/high-availability.py b/src/conf_mode/high-availability.py index f939f9469..e14050dd3 100755 --- a/src/conf_mode/high-availability.py +++ b/src/conf_mode/high-availability.py @@ -28,7 +28,6 @@ from vyos.template import render from vyos.template import is_ipv4 from vyos.template import is_ipv6 from vyos.util import call -from vyos.util import is_systemd_service_running from vyos.xml import defaults from vyos import ConfigError from vyos import airbag @@ -161,12 +160,7 @@ def apply(ha): call(f'systemctl stop {service_name}') return None - # XXX: T3944 - reload keepalived configuration if service is already running - # to not cause any service disruption when applying changes. - if is_systemd_service_running(service_name): - call(f'systemctl reload {service_name}') - else: - call(f'systemctl restart {service_name}') + call(f'systemctl reload-or-restart {service_name}') return None if __name__ == '__main__': -- cgit v1.2.3