summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-06-19 22:22:41 +0200
committerChristian Poessinger <christian@poessinger.com>2020-06-19 22:22:41 +0200
commit7e258d0f77c005baf27a50160aa8b82b8562975c (patch)
tree4f47ec59cc96be1fbca6866927d048287e433a0f
parentbe68f60ad4b4fcfbcf5e51808b8fc478f84386ad (diff)
downloadvyos-1x-7e258d0f77c005baf27a50160aa8b82b8562975c.tar.gz
vyos-1x-7e258d0f77c005baf27a50160aa8b82b8562975c.zip
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.
-rwxr-xr-xsrc/migration-scripts/interfaces/5-to-618
1 files changed, 11 insertions, 7 deletions
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