summaryrefslogtreecommitdiff
path: root/src/conf_mode/vrrp.py
diff options
context:
space:
mode:
authorzdc <zdc@users.noreply.github.com>2021-11-01 17:04:11 +0200
committerGitHub <noreply@github.com>2021-11-01 17:04:11 +0200
commit1b7c879b9fed2f4563477039bc6ddf4dc0db5829 (patch)
treea0ea609a933a4d2e54d5712e2b1671a19181c372 /src/conf_mode/vrrp.py
parent3fd2ff423b6c6e992b2ed531c7ba99fb9e1a2123 (diff)
parent85bf315f71b411e3cdcd19793c4f7e1e5efed917 (diff)
downloadvyos-1x-1b7c879b9fed2f4563477039bc6ddf4dc0db5829.tar.gz
vyos-1x-1b7c879b9fed2f4563477039bc6ddf4dc0db5829.zip
Merge branch 'current' into T3350-sagitta
Diffstat (limited to 'src/conf_mode/vrrp.py')
-rwxr-xr-xsrc/conf_mode/vrrp.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/conf_mode/vrrp.py b/src/conf_mode/vrrp.py
index e8f1c1f99..c72efc61f 100755
--- a/src/conf_mode/vrrp.py
+++ b/src/conf_mode/vrrp.py
@@ -28,6 +28,7 @@ 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
@@ -139,7 +140,12 @@ def apply(vrrp):
call(f'systemctl stop {service_name}')
return None
- call(f'systemctl restart {service_name}')
+ # 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}')
return None
if __name__ == '__main__':