Small refactor, to allow for more interface types to be added as l2xc targets later
This commit is contained in:
@ -160,15 +160,14 @@ def is_l2xc_interface(yaml, ifname):
|
|||||||
def get_l2xc_target_interfaces(yaml):
|
def get_l2xc_target_interfaces(yaml):
|
||||||
""" Returns a list of all interfaces that are the target of an L2 CrossConnect """
|
""" Returns a list of all interfaces that are the target of an L2 CrossConnect """
|
||||||
ret = []
|
ret = []
|
||||||
if not 'interfaces' in yaml:
|
if 'interfaces' in yaml:
|
||||||
return ret
|
for ifname, iface in yaml['interfaces'].items():
|
||||||
for ifname, iface in yaml['interfaces'].items():
|
if 'l2xc' in iface:
|
||||||
if 'l2xc' in iface:
|
ret.append(iface['l2xc'])
|
||||||
ret.append(iface['l2xc'])
|
if 'sub-interfaces' in iface:
|
||||||
if 'sub-interfaces' in iface:
|
for sub_ifname, sub_iface in iface['sub-interfaces'].items():
|
||||||
for sub_ifname, sub_iface in iface['sub-interfaces'].items():
|
if 'l2xc' in sub_iface:
|
||||||
if 'l2xc' in sub_iface:
|
ret.append(sub_iface['l2xc'])
|
||||||
ret.append(sub_iface['l2xc'])
|
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user