summaryrefslogtreecommitdiff
path: root/python/vyos/ifconfig
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-05 18:15:31 +0200
committerChristian Poessinger <christian@poessinger.com>2020-04-05 18:15:31 +0200
commit9b98256339f35ff5de346b08fb1573429a0801f8 (patch)
treef1ba049b8d4d1d3e1983a828cffc57c478ef70a1 /python/vyos/ifconfig
parentf05c683cf1ff4a829f3285ffc791b87b4dc656ac (diff)
downloadvyos-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/vyos/ifconfig')
-rw-r--r--python/vyos/ifconfig/l2tpv3.py16
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():