Fix up bond netplan.

This commit is contained in:
Dimitri John Ledkov 2018-07-07 03:29:30 +01:00 committed by Michael Hudson-Doyle
parent 87ef3749e6
commit 88b64ca7fd
1 changed files with 6 additions and 5 deletions

View File

@ -65,11 +65,12 @@ class Networkdev:
if self.type == 'bond':
bond = self._net_info.bond
self._configuration['interfaces'] = bond['slaves']
self._configuration['parameters'] = {
'mode': bond['mode'],
'lacp-rate': bond['lacp_rate'],
'transmit-hash-policy': bond['xmit_hash_policy'],
}
params = {'mode': bond['mode']}
if bond['mode'] in ['balance-xor', '802.3ad', 'balance-tlb']:
params['transmit-hash-policy'] = bond['xmit_hash_policy']
if bond['mode'] == '802.3ad':
params['lacp-rate'] = bond['lacp_rate']
self._configuration['parameters'] = params
def render(self):
if (self.configured_ip_addresses or self.dhcp4 or self.dhcp6 or