diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-04-11 15:33:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-11 15:33:01 +0200 |
commit | c27f13ab459ef5116eeac417d256abfabf2690c2 (patch) | |
tree | 7b58f7a9fc88bfa24efde7a2196b923f78c96586 /src/conf_mode/interfaces-ethernet.py | |
parent | 74f498f8119a53c801b5e8d37186742b8b303734 (diff) | |
parent | e12a0ce922b67354ecd8e53414cda6b8b3a424fb (diff) | |
download | vyos-1x-c27f13ab459ef5116eeac417d256abfabf2690c2.tar.gz vyos-1x-c27f13ab459ef5116eeac417d256abfabf2690c2.zip |
Merge pull request #326 from thomas-mangin/T2265
dhcp: T2265: refactor DHCP class
Diffstat (limited to 'src/conf_mode/interfaces-ethernet.py')
-rwxr-xr-x | src/conf_mode/interfaces-ethernet.py | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/src/conf_mode/interfaces-ethernet.py b/src/conf_mode/interfaces-ethernet.py index 15e9b4185..5a977d797 100755 --- a/src/conf_mode/interfaces-ethernet.py +++ b/src/conf_mode/interfaces-ethernet.py @@ -301,32 +301,20 @@ def apply(eth): # update interface description used e.g. within SNMP e.set_alias(eth['description']) - # get DHCP config dictionary and update values - opt = e.get_dhcp_options() - if eth['dhcp_client_id']: - opt['client_id'] = eth['dhcp_client_id'] + e.dhcp.v4.options['client_id'] = eth['dhcp_client_id'] if eth['dhcp_hostname']: - opt['hostname'] = eth['dhcp_hostname'] + e.dhcp.v4.options['hostname'] = eth['dhcp_hostname'] if eth['dhcp_vendor_class_id']: - opt['vendor_class_id'] = eth['dhcp_vendor_class_id'] - - # store DHCP config dictionary - used later on when addresses are aquired - e.set_dhcp_options(opt) - - # get DHCPv6 config dictionary and update values - opt = e.get_dhcpv6_options() + e.dhcp.v4.options['vendor_class_id'] = eth['dhcp_vendor_class_id'] if eth['dhcpv6_prm_only']: - opt['dhcpv6_prm_only'] = True + e.dhcp.v6.options['dhcpv6_prm_only'] = True if eth['dhcpv6_temporary']: - opt['dhcpv6_temporary'] = True - - # store DHCPv6 config dictionary - used later on when addresses are aquired - e.set_dhcpv6_options(opt) + e.dhcp.v6.options['dhcpv6_temporary'] = True # ignore link state changes e.set_link_detect(eth['disable_link_detect']) |