summaryrefslogtreecommitdiff
path: root/src/migration-scripts/pppoe-server/2-to-3
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-18 21:36:04 +0200
committerChristian Poessinger <christian@poessinger.com>2020-04-18 21:36:04 +0200
commit0ffdf24983507bb8140e6d30343993059abfc4dd (patch)
tree53b21eb45fde4621f49a54286db1f94fe4bfe05f /src/migration-scripts/pppoe-server/2-to-3
parent0988b60f813cb1659785e0e92a165052f7d67311 (diff)
parent68ebb2a39c6d98a4d2cc25b9b84e4a9594238608 (diff)
downloadvyos-1x-0ffdf24983507bb8140e6d30343993059abfc4dd.tar.gz
vyos-1x-0ffdf24983507bb8140e6d30343993059abfc4dd.zip
Merge branch 'ipoe-server' of github.com:c-po/vyos-1x into current
* 'ipoe-server' of github.com:c-po/vyos-1x: pppoe-server: T2314: fix RADIUS migration vyos.configtree: bugfix exception message used non existent variable ipoe-server: T2324: migrate RADIUS configuration to common CLI syntax ipoe-server: T2324: migrate IPv4/IPv6 name-servers to common node ipoe-server: T2324: remove boilerplate code and adjust to other accel implementations router-advert: rename XML/Python files for a common pattern ipoe-server: rename XML/Python files for a common pattern
Diffstat (limited to 'src/migration-scripts/pppoe-server/2-to-3')
-rwxr-xr-xsrc/migration-scripts/pppoe-server/2-to-327
1 files changed, 21 insertions, 6 deletions
diff --git a/src/migration-scripts/pppoe-server/2-to-3 b/src/migration-scripts/pppoe-server/2-to-3
index 3f5415a94..d5d88d373 100755
--- a/src/migration-scripts/pppoe-server/2-to-3
+++ b/src/migration-scripts/pppoe-server/2-to-3
@@ -68,12 +68,27 @@ else:
config.delete(wins_base)
- # Remove RADIUS server req-limit node
- radius_base = base + ['authentication', 'radius']
- if config.exists(radius_base):
- for server in config.list_nodes(radius_base + ['server']):
- if config.exists(radius_base + ['server', server, 'req-limit']):
- config.delete(radius_base + ['server', server, 'req-limit'])
+ # Migrate radius-settings node to RADIUS and use this as base for the
+ # later migration of the RADIUS servers - this will save a lot of code
+ radius_settings = base + ['authentication', 'radius-settings']
+ if config.exists(radius_settings):
+ config.rename(radius_settings, 'radius')
+
+ # Migrate RADIUS server
+ radius_server = base + ['authentication', 'radius-server']
+ if config.exists(radius_server):
+ new_base = base + ['authentication', 'radius', 'server']
+ config.set(new_base)
+ config.set_tag(new_base)
+ for server in config.list_nodes(radius_server):
+ old_base = radius_server + [server]
+ config.copy(old_base, new_base + [server])
+
+ # remove old req-limit node
+ if config.exists(new_base + [server, 'req-limit']):
+ config.delete(new_base + [server, 'req-limit'])
+
+ config.delete(radius_server)
# Migrate IPv6 prefixes
ipv6_base = base + ['client-ipv6-pool']