diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-05-26 20:54:07 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-05-26 20:54:07 +0200 |
commit | 825059e83237dd389d461257e1b46625084702df (patch) | |
tree | 47d50cde1195279ab5b6367b84ff60568620262a /python/vyos/configdict.py | |
parent | 62fd70e83c2f147f84f8fb3def5b384d4f56695d (diff) | |
parent | 8ff6d2ed6025fb113a180e3c23be83dac7169658 (diff) | |
download | vyos-1x-825059e83237dd389d461257e1b46625084702df.tar.gz vyos-1x-825059e83237dd389d461257e1b46625084702df.zip |
Merge branch 'dhcpv6-pd-t2506' of github.com:c-po/vyos-1x into current
* 'dhcpv6-pd-t2506' of github.com:c-po/vyos-1x:
dhcpv6-pd: T2506: use common dictionary definition for config parameters
dhcpv6-pd: T2506: add option to request specific prefix length
dhcpv6-pd: pppoe: T2506: restructure CLI
Diffstat (limited to 'python/vyos/configdict.py')
-rw-r--r-- | python/vyos/configdict.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index eec64e964..c89447163 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -103,16 +103,21 @@ def get_ethertype(ethertype_val): else: raise ConfigError('invalid ethertype "{}"'.format(ethertype_val)) +dhcpv6_pd_default_data = { + 'dhcpv6_prm_only': False, + 'dhcpv6_temporary': False, + 'dhcpv6_pd_length': '', + 'dhcpv6_pd_interfaces': [] +} + interface_default_data = { + **dhcpv6_pd_default_data, 'address': [], 'address_remove': [], 'description': '', 'dhcp_client_id': '', 'dhcp_hostname': '', 'dhcp_vendor_class_id': '', - 'dhcpv6_prm_only': False, - 'dhcpv6_temporary': False, - 'dhcpv6_pd': [], 'disable': False, 'disable_link_detect': 1, 'ip_disable_arp_filter': 1, @@ -245,10 +250,10 @@ def intf_to_dict(conf, default): if conf.exists(['sla-len']): pd['sla_len'] = conf.return_value(['sla-len']) - if conf.exists(['interface-id']): - pd['if_id'] = conf.return_value(['interface-id']) + if conf.exists(['address']): + pd['if_id'] = conf.return_value(['address']) - intf['dhcpv6_pd'].append(pd) + intf['dhcpv6_pd_interfaces'].append(pd) # re-set config level conf.set_level(current_level) |