summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-12-02 20:01:08 +0100
committerGitHub <noreply@github.com>2022-12-02 20:01:08 +0100
commit3ef14453e0685d6a22a5ab48668726ca080a89cd (patch)
treedb59fcfca313d76aec5d00a84c4c4ce54c6d7944 /src
parent1c792052d435f33a3ef634b57f780e3f00909a9f (diff)
parent63c18aefa85f5b5b749932eae4def675a7d23f51 (diff)
downloadvyos-1x-3ef14453e0685d6a22a5ab48668726ca080a89cd.tar.gz
vyos-1x-3ef14453e0685d6a22a5ab48668726ca080a89cd.zip
Merge pull request #1685 from sever-sever/T4805
T4805: Restart pppoe-server if client pool was changed
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/service_pppoe-server.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/conf_mode/service_pppoe-server.py b/src/conf_mode/service_pppoe-server.py
index ba0249efd..600ba4e92 100755
--- a/src/conf_mode/service_pppoe-server.py
+++ b/src/conf_mode/service_pppoe-server.py
@@ -20,6 +20,7 @@ from sys import exit
from vyos.config import Config
from vyos.configdict import get_accel_dict
+from vyos.configdict import is_node_changed
from vyos.configverify import verify_accel_ppp_base_service
from vyos.configverify import verify_interface_exists
from vyos.template import render
@@ -43,6 +44,13 @@ def get_config(config=None):
# retrieve common dictionary keys
pppoe = get_accel_dict(conf, base, pppoe_chap_secrets)
+
+ # reload-or-restart does not implemented in accel-ppp
+ # use this workaround until it will be implemented
+ # https://phabricator.accel-ppp.org/T3
+ if is_node_changed(conf, base + ['client-ip-pool']) or is_node_changed(
+ conf, base + ['client-ipv6-pool']):
+ pppoe.update({'restart_required': {}})
return pppoe
def verify(pppoe):
@@ -95,7 +103,10 @@ def apply(pppoe):
os.unlink(file)
return None
- call(f'systemctl reload-or-restart {systemd_service}')
+ if 'restart_required' in pppoe:
+ call(f'systemctl restart {systemd_service}')
+ else:
+ call(f'systemctl reload-or-restart {systemd_service}')
if __name__ == '__main__':
try: