From 582b718221c67ddb71e39fbad0a72241761304a9 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 27 Feb 2021 21:37:15 +0100 Subject: 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. --- src/migration-scripts/interfaces/19-to-20 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/migration-scripts/interfaces/19-to-20') 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 encapsulation gre-bridge" to gretap + # Migrate "interface tunnel 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: -- cgit v1.2.3