From afc82770cce851da31267829f1726f85093d9d76 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Tue, 8 Oct 2019 21:23:57 +0200 Subject: Python/ifconfig: T1557: add generic support for DHCP client options --- src/conf_mode/interface-bonding.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/conf_mode/interface-bonding.py') diff --git a/src/conf_mode/interface-bonding.py b/src/conf_mode/interface-bonding.py index 4d5009c73..7caf9e0e8 100755 --- a/src/conf_mode/interface-bonding.py +++ b/src/conf_mode/interface-bonding.py @@ -368,9 +368,18 @@ def apply(bond): # update interface description used e.g. within SNMP b.set_alias(bond['description']) - # - # missing DHCP/DHCPv6 options go here - # + # get DHCP config dictionary and update values + opt = b.get_dhcp_options() + + if bond['dhcp_client_id']: + opt['client_id'] = bond['dhcp_client_id'] + + if bond['dhcp_hostname']: + opt['hostname'] = bond['dhcp_hostname'] + + # store DHCP config dictionary - used later on when addresses + # are requested + b.set_dhcp_options(opt) # ignore link state changes b.set_link_detect(bond['disable_link_detect']) -- cgit v1.2.3