summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-04-22 22:04:04 +0200
committerChristian Poessinger <christian@poessinger.com>2022-04-22 22:04:37 +0200
commit305aafacf2b7aa952316599cd77862576233fba3 (patch)
tree10aa8a2ad38e94e879de9d3aaa629e7369cf87ae
parent677730107abc42d863f28c5decd4dadb761ee515 (diff)
downloadvyos-1x-305aafacf2b7aa952316599cd77862576233fba3.tar.gz
vyos-1x-305aafacf2b7aa952316599cd77862576233fba3.zip
dhcpv6: T4357: use variable for systemd service name
-rwxr-xr-xsrc/conf_mode/dhcpv6_server.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/conf_mode/dhcpv6_server.py b/src/conf_mode/dhcpv6_server.py
index 25f37d4fc..078ff327c 100755
--- a/src/conf_mode/dhcpv6_server.py
+++ b/src/conf_mode/dhcpv6_server.py
@@ -173,15 +173,15 @@ def generate(dhcpv6):
def apply(dhcpv6):
# bail out early - looks like removal from running config
+ service_name = 'isc-dhcp-server6.service'
if not dhcpv6 or 'disable' in dhcpv6:
# DHCP server is removed in the commit
- call('systemctl stop isc-dhcp-server6.service')
+ call(f'systemctl stop {service_name}')
if os.path.exists(config_file):
os.unlink(config_file)
-
return None
- call('systemctl restart isc-dhcp-server6.service')
+ call(f'systemctl restart {service_name}')
return None
if __name__ == '__main__':