diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-09-25 08:55:50 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-09-25 13:10:47 +0200 |
commit | b34b8a8fe3bc4a4a706c22af4a7ef4ea8a75e14b (patch) | |
tree | 083173a665a7f37ad2f4dd748d9a28c67c8bbe15 /python | |
parent | 823b03417aa6ac717e785b741541e251c0d4125f (diff) | |
download | vyos-1x-b34b8a8fe3bc4a4a706c22af4a7ef4ea8a75e14b.tar.gz vyos-1x-b34b8a8fe3bc4a4a706c22af4a7ef4ea8a75e14b.zip |
vyos.ifconfig: dhcpv6: re-use systemd_service definition variable
(cherry picked from commit d1c58addd881e06b389799a9c14d8ebf5d03c567)
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/ifconfig/interface.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py index 1098df7fd..76f1e158a 100644 --- a/python/vyos/ifconfig/interface.py +++ b/python/vyos/ifconfig/interface.py @@ -1163,16 +1163,16 @@ class Interface(Control): ifname = self.ifname config_file = f'/run/dhcp6c/dhcp6c.{ifname}.conf' + systemd_service = f'dhcp6c@{ifname}.service' if enable and 'disable' not in self._config: render(config_file, 'dhcp-client/ipv6.tmpl', self._config) - # We must ignore any return codes. This is required to enable DHCPv6-PD - # for interfaces which are yet not up and running. - return self._popen(f'systemctl restart dhcp6c@{ifname}.service') + # We must ignore any return codes. This is required to enable + # DHCPv6-PD for interfaces which are yet not up and running. + return self._popen(f'systemctl restart {systemd_service}') else: - systemd_service = f'dhcp6c@{ifname}.service' if is_systemd_service_active(systemd_service): self._cmd(f'systemctl stop {systemd_service}') if os.path.isfile(config_file): |