Ensure bridgedomains exist in the YAML config before trying to look up BVIs in them

This commit is contained in:
Pim van Pelt
2022-03-24 21:57:39 +00:00
parent 3a74a07ee6
commit 4666ba1611

View File

@ -39,6 +39,8 @@ def get_by_lcp_name(yaml, lcpname):
def get_by_bvi_name(yaml, ifname):
""" Return the BridgeDomain by BVI interface name (bvi*), if it exists. Return None,None otherwise. """
if not 'bridgedomains' in yaml:
return None,None
if not ifname.startswith("bvi"):
return None,None
idx = ifname[3:]