From 7e258d0f77c005baf27a50160aa8b82b8562975c Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 19 Jun 2020 22:22:41 +0200 Subject: router-advert: T2618: fix for wrongly converted "autonomous-flag" Boolean nodes have been removed b/c a boolean value makes less sense. The same behavior can be achieved with the presence or absence of a node. Unfortunately the 'autonomous-flag' node has been a negated one which did not migrate it to 'no-autonomous-flag' if it was set to false previously. --- src/migration-scripts/interfaces/5-to-6 | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/migration-scripts/interfaces') diff --git a/src/migration-scripts/interfaces/5-to-6 b/src/migration-scripts/interfaces/5-to-6 index 85a1994c6..1291751d8 100755 --- a/src/migration-scripts/interfaces/5-to-6 +++ b/src/migration-scripts/interfaces/5-to-6 @@ -59,13 +59,17 @@ def copy_rtradv(c, old_base, interface): prefix_base = new_base + ['prefix'] if c.exists(prefix_base): for prefix in config.list_nodes(prefix_base): - bool_cleanup = ['autonomous-flag', 'on-link-flag'] - for bool in bool_cleanup: - if c.exists(prefix_base + [prefix, bool]): - tmp = c.return_value(prefix_base + [prefix, bool]) - c.delete(prefix_base + [prefix, bool]) - if tmp == 'true': - c.set(prefix_base + [prefix, bool]) + if c.exists(prefix_base + [prefix, 'autonomous-flag']): + tmp = c.return_value(prefix_base + [prefix, 'autonomous-flag']) + c.delete(prefix_base + [prefix, 'autonomous-flag']) + if tmp == 'false': + c.set(prefix_base + [prefix, 'no-autonomous-flag']) + + if c.exists(prefix_base + [prefix, 'on-link-flag']): + tmp = c.return_value(prefix_base + [prefix, 'on-link-flag']) + c.delete(prefix_base + [prefix, 'on-link-flag']) + if tmp == 'true': + c.set(prefix_base + [prefix, 'on-link-flag']) # router advertisement can be individually disabled per interface # the node has been renamed from send-advert {true | false} to no-send-advert -- cgit v1.2.3