diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/configdict.py | 17 | ||||
-rw-r--r-- | python/vyos/ifconfig/dhcp.py | 3 | ||||
-rw-r--r-- | python/vyos/ifconfig_vlan.py | 7 |
3 files changed, 18 insertions, 9 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) diff --git a/python/vyos/ifconfig/dhcp.py b/python/vyos/ifconfig/dhcp.py index f8fdeb6a9..a8b9a2a87 100644 --- a/python/vyos/ifconfig/dhcp.py +++ b/python/vyos/ifconfig/dhcp.py @@ -86,7 +86,8 @@ class _DHCPv6 (Control): 'ifname': ifname, 'dhcpv6_prm_only': False, 'dhcpv6_temporary': False, - 'dhcpv6_pd': [], + 'dhcpv6_pd_interfaces': [], + 'dhcpv6_pd_length': '' }) self._conf_file = f'/run/dhcp6c/dhcp6c.{ifname}.conf' diff --git a/python/vyos/ifconfig_vlan.py b/python/vyos/ifconfig_vlan.py index a53136ebf..53a77c651 100644 --- a/python/vyos/ifconfig_vlan.py +++ b/python/vyos/ifconfig_vlan.py @@ -87,8 +87,11 @@ def apply_vlan_config(vlan, config): if config['dhcpv6_temporary']: vlan.dhcp.v6.options['dhcpv6_temporary'] = True - if config['dhcpv6_pd']: - vlan.dhcp.v6.options['dhcpv6_pd'] = config['dhcpv6_pd'] + if config['dhcpv6_pd_length']: + vlan.dhcp.v6.options['dhcpv6_pd_length'] = config['dhcpv6_pd_length'] + + if config['dhcpv6_pd_interfaces']: + vlan.dhcp.v6.options['dhcpv6_pd_interfaces'] = config['dhcpv6_pd_interfaces'] # update interface description used e.g. within SNMP vlan.set_alias(config['description']) |