diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-02-28 10:14:20 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-02-28 18:10:08 +0100 |
commit | 5574bd672825a87b1983cc135ae2e0bdabbe751b (patch) | |
tree | 51172c12b38525028db29a4321b759cb9c6c8773 /src/conf_mode | |
parent | f585fd497ad0daa4cbecd777bb5e8fa6d18f879f (diff) | |
download | vyos-1x-5574bd672825a87b1983cc135ae2e0bdabbe751b.tar.gz vyos-1x-5574bd672825a87b1983cc135ae2e0bdabbe751b.zip |
l2tpv3: T3366: migrate local-ip and remote-ip CLI options
Rename CLI options local-ip to source-address and remote-ip to remote to
get a consistent CLI experience for the user.
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/interfaces-l2tpv3.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/conf_mode/interfaces-l2tpv3.py b/src/conf_mode/interfaces-l2tpv3.py index 5bae66074..9b6ddd5aa 100755 --- a/src/conf_mode/interfaces-l2tpv3.py +++ b/src/conf_mode/interfaces-l2tpv3.py @@ -34,7 +34,6 @@ airbag.enable() k_mod = ['l2tp_eth', 'l2tp_netlink', 'l2tp_ip', 'l2tp_ip6'] - def get_config(config=None): """ Retrive CLI config as dictionary. Dictionary can never be empty, as at least the @@ -65,15 +64,15 @@ def verify(l2tpv3): interface = l2tpv3['ifname'] - for key in ['local_ip', 'remote_ip', 'tunnel_id', 'peer_tunnel_id', + for key in ['source_address', 'remote', 'tunnel_id', 'peer_tunnel_id', 'session_id', 'peer_session_id']: if key not in l2tpv3: tmp = key.replace('_', '-') - raise ConfigError(f'L2TPv3 {tmp} must be configured!') + raise ConfigError(f'Missing mandatory L2TPv3 option: "{tmp}"!') - if not is_addr_assigned(l2tpv3['local_ip']): - raise ConfigError('L2TPv3 local-ip address ' - '"{local_ip}" is not configured!'.format(**l2tpv3)) + if not is_addr_assigned(l2tpv3['source_address']): + raise ConfigError('L2TPv3 source-address address "{source_address}" ' + 'not configured on any interface!'.format(**l2tpv3)) verify_mtu_ipv6(l2tpv3) verify_address(l2tpv3) |