From efa172449e05328f8bea8d6879d5d38386b72e95 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 18 Apr 2020 21:46:22 +0200 Subject: ipoe-server: T2324: migrate IPv6 client IP pool to common CLI nodes --- src/conf_mode/service_ipoe-server.py | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'src/conf_mode') diff --git a/src/conf_mode/service_ipoe-server.py b/src/conf_mode/service_ipoe-server.py index 958fbd561..428d8d5d5 100755 --- a/src/conf_mode/service_ipoe-server.py +++ b/src/conf_mode/service_ipoe-server.py @@ -202,10 +202,29 @@ def get_config(): conf.set_level(base_path) if conf.exists(['client-ipv6-pool', 'prefix']): - ipoe['client_ipv6_pool'] = conf.return_values(['client-ipv6-pool', 'prefix']) + for prefix in conf.list_nodes(['client-ipv6-pool', 'prefix']): + tmp = { + 'prefix': prefix, + 'mask': '64' + } + + if conf.exists(['client-ipv6-pool', 'prefix', prefix, 'mask']): + tmp['mask'] = conf.return_value(['client-ipv6-pool', 'prefix', prefix, 'mask']) + + ipoe['client_ipv6_pool'].append(tmp) + + + if conf.exists(['client-ipv6-pool', 'delegate']): + for prefix in conf.list_nodes(['client-ipv6-pool', 'delegate']): + tmp = { + 'prefix': prefix, + 'mask': '' + } + + if conf.exists(['client-ipv6-pool', 'delegate', prefix, 'delegation-prefix']): + tmp['mask'] = conf.return_value(['client-ipv6-pool', 'delegate', prefix, 'delegation-prefix']) - if conf.exists(['client-ipv6-pool', 'delegate-prefix']): - ipoe['client_ipv6_delegate_prefix'] = conf.return_values(['client-ipv6-pool', 'delegate-prefix']) + ipoe['client_ipv6_delegate_prefix'].append(tmp) return ipoe -- cgit v1.2.3