diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-04-05 18:15:31 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-04-05 18:15:31 +0200 |
commit | 9b98256339f35ff5de346b08fb1573429a0801f8 (patch) | |
tree | f1ba049b8d4d1d3e1983a828cffc57c478ef70a1 /python | |
parent | f05c683cf1ff4a829f3285ffc791b87b4dc656ac (diff) | |
download | vyos-1x-9b98256339f35ff5de346b08fb1573429a0801f8.tar.gz vyos-1x-9b98256339f35ff5de346b08fb1573429a0801f8.zip |
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.
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/ifconfig/l2tpv3.py | 16 |
1 files 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(): |