Allow bondethernet members list to be empty, and omitted from the YAML config

This commit is contained in:
Pim van Pelt
2022-04-05 16:08:51 +00:00
parent 41bce7131c
commit 8971c325c0
5 changed files with 22 additions and 3 deletions

View File

@ -275,7 +275,10 @@ class VPPApiDumper(VPPApi):
for idx, iface in self.cache['bondethernets'].items():
bond = {"description": ""}
if iface.sw_if_index in self.cache['bondethernet_members']:
bond['interfaces'] = [self.cache['interfaces'][x].interface_name for x in self.cache['bondethernet_members'][iface.sw_if_index]]
members = [self.cache['interfaces'][x].interface_name for x in self.cache['bondethernet_members'][iface.sw_if_index]]
if len(members) > 0:
bond['interfaces'] = members
mode = bondethernet.int_to_mode(iface.mode)
bond['mode'] = mode
if mode in ['xor', 'lacp']: