From f5ecc5a40fcf07d9ad08864fbac710717330c255 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Tue, 4 Aug 2020 08:29:38 +0200 Subject: dhcpv6-pd: T2741: support delegation on non existing interfaces We must ignore any return code when invoking dhcpc6 initially. This is required to enable DHCPv6-PD for interfaces which are yet not up and running and my be started later by VyOS. --- python/vyos/ifconfig/dhcp.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'python') diff --git a/python/vyos/ifconfig/dhcp.py b/python/vyos/ifconfig/dhcp.py index 5f99a0b7e..63224fc0f 100644 --- a/python/vyos/ifconfig/dhcp.py +++ b/python/vyos/ifconfig/dhcp.py @@ -103,7 +103,10 @@ class _DHCPv6 (Control): render(self._config, 'dhcp-client/ipv6.tmpl', self.options, trim_blocks=True) - return self._cmd('systemctl restart dhcp6c@{ifname}.service'.format( + + # 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('systemctl restart dhcp6c@{ifname}.service'.format( **self.options)) def delete(self): -- cgit v1.2.3