From 9b98256339f35ff5de346b08fb1573429a0801f8 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 5 Apr 2020 18:15:31 +0200 Subject: ifconfig: l2tpv3: T1823: fix remaining errors in config syntax Commit b5310b0 ("ifconfig: l2tpv3: T1823: fix configuration build syntax") did not cover all parts of the l2tpv3 config. Some parts when e.g. adjusting l2tpv3 addresses after the tunnel was created did fail with the same error. This has been fixed. --- python/vyos/ifconfig/l2tpv3.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/python/vyos/ifconfig/l2tpv3.py b/python/vyos/ifconfig/l2tpv3.py index f0d64a53d..34147eb38 100644 --- a/python/vyos/ifconfig/l2tpv3.py +++ b/python/vyos/ifconfig/l2tpv3.py @@ -80,16 +80,14 @@ class L2TPv3If(Interface): # interface is always A/D down. It needs to be enabled explicitly self.set_admin_state('down') - if self._config['tunnel_id'] and self._config['session_id']: - cmd = 'ip l2tp del session tunnel_id {} '.format( - self._config['tunnel_id']) - cmd += 'session_id {} '.format(self._config['session_id']) - self._cmd(cmd) + if self.config['tunnel_id'] and self.config['session_id']: + cmd = 'ip l2tp del session tunnel_id {tunnel_id}' + cmd += ' session_id {session_id}' + self._cmd(cmd.format(**self.config)) - if self._config['tunnel_id']: - cmd = 'ip l2tp del tunnel tunnel_id {} '.format( - self._config['tunnel_id']) - self._cmd(cmd) + if self.config['tunnel_id']: + cmd = 'ip l2tp del tunnel tunnel_id {tunnel_id}' + self._cmd(cmd.format(**self.config)) @staticmethod def get_config(): -- cgit v1.2.3