From d58e7ace7075e24c64cfe5e56ffcaad1688446e9 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Thu, 12 Dec 2024 20:57:29 +0100 Subject: multicast: T6746: migrate CLI to to mimic unicast IPv4 routes syntax Consolidate "multicast interface-route" and "multicast route" under common "mroute " CLI node. --- src/migration-scripts/quagga/11-to-12 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/migration-scripts') diff --git a/src/migration-scripts/quagga/11-to-12 b/src/migration-scripts/quagga/11-to-12 index becc44162..8ae2023a1 100644 --- a/src/migration-scripts/quagga/11-to-12 +++ b/src/migration-scripts/quagga/11-to-12 @@ -23,6 +23,7 @@ static_base = ['protocols', 'static'] def migrate(config: ConfigTree) -> None: # Check for static route/route6 configuration + # Migrate static BFD configuration to match FRR possibillities for route_route6 in ['route', 'route6']: route_route6_base = static_base + [route_route6] if not config.exists(route_route6_base): @@ -52,3 +53,23 @@ def migrate(config: ConfigTree) -> None: config.delete(multi_hop_base) config.set(multi_hop_base + ['source-address'], value=source) config.set(next_hop_base + [next_hop, 'bfd', 'profile'], value=profile) + + # Consolidate static multicast routing configuration under a new node + if config.exists(static_base + ['multicast']): + for mroute in ['interface-route', 'route']: + mroute_base = static_base + ['multicast', mroute] + if not config.exists(mroute_base): + continue + config.set(static_base + ['mroute']) + config.set_tag(static_base + ['mroute']) + for route in config.list_nodes(mroute_base): + config.copy(mroute_base + [route], static_base + ['mroute', route]) + + mroute_base = static_base + ['mroute'] + if config.exists(mroute_base): + for mroute in config.list_nodes(mroute_base): + interface_path = mroute_base + [mroute, 'next-hop-interface'] + if config.exists(interface_path): + config.rename(interface_path, 'interface') + + config.delete(static_base + ['multicast']) -- cgit v1.2.3