From cc7ba8824a5e9ec818f0bbe7fb85e1713a591527 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Mon, 30 Oct 2023 16:23:30 +0100 Subject: vxlan: T5699: migrate "external" CLI know to "parameters external" As we have a bunch of options under "paramteres" already and "external" is clearly one of them it should be migrated under that node as well. --- src/migration-scripts/interfaces/31-to-32 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/migration-scripts/interfaces') diff --git a/src/migration-scripts/interfaces/31-to-32 b/src/migration-scripts/interfaces/31-to-32 index 35b397c39..ca3d19320 100755 --- a/src/migration-scripts/interfaces/31-to-32 +++ b/src/migration-scripts/interfaces/31-to-32 @@ -27,7 +27,8 @@ if len(argv) < 2: file_name = argv[1] with open(file_name, 'r') as f: config_file = f.read() - base = ['interfaces', 'vxlan'] + +base = ['interfaces', 'vxlan'] config = ConfigTree(config_file) if not config.exists(base): @@ -35,7 +36,11 @@ if not config.exists(base): exit(0) for vxlan in config.list_nodes(base): - if not config.exists(base + ['port']): + if config.exists(base + [vxlan, 'external']): + config.delete(base + [vxlan, 'external']) + config.set(base + [vxlan, 'parameters', 'external']) + + if not config.exists(base + [vxlan, 'port']): config.set(base + [vxlan, 'port'], value='8472') try: -- cgit v1.2.3