diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-02-27 21:37:15 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-02-28 00:54:37 +0100 |
commit | 582b718221c67ddb71e39fbad0a72241761304a9 (patch) | |
tree | 4bb7c0ea424ce74137e5ba966e05bbeef4e7cede /src/migration-scripts/interfaces | |
parent | 8f100189086102458ff8e4f61f842cf44a6bf8aa (diff) | |
download | vyos-1x-582b718221c67ddb71e39fbad0a72241761304a9.tar.gz vyos-1x-582b718221c67ddb71e39fbad0a72241761304a9.zip |
tunnel: T3366: rename local-ip to source-address
Streamline the CLI configuration where we try to use source-address when
creating connections which are especially sourced from a discrete address.
Diffstat (limited to 'src/migration-scripts/interfaces')
-rwxr-xr-x | src/migration-scripts/interfaces/19-to-20 | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/migration-scripts/interfaces/19-to-20 b/src/migration-scripts/interfaces/19-to-20 index be42cdd61..1727ac4dc 100755 --- a/src/migration-scripts/interfaces/19-to-20 +++ b/src/migration-scripts/interfaces/19-to-20 @@ -36,12 +36,17 @@ if __name__ == '__main__': # # Migrate "interface tunnel <tunX> encapsulation gre-bridge" to gretap + # Migrate "interface tunnel <tunX> local-ip" to source-address for interface in config.list_nodes(base): - path = base + [interface, 'encapsulation'] - if config.exists(path): - tmp = config.return_value(path) + encap_path = base + [interface, 'encapsulation'] + if config.exists(encap_path): + tmp = config.return_value(encap_path) if tmp == 'gre-bridge': - config.set(path, value='gretap') + config.set(encap_path, value='gretap') + + local_ip_path = base + [interface, 'local-ip'] + if config.exists(local_ip_path): + config.rename(local_ip_path, 'source-address') try: with open(file_name, 'w') as f: |