Refactor for *_get_by_name()
They now all return a list [ifname, iface]. If no interface was found they return None,None. If one was found, they return the (string) name and the dictionary with interface contents.
This commit is contained in:
@ -24,7 +24,7 @@ def get_by_name(yaml, ifname):
|
||||
""" Return the VXLAN by name, if it exists. Return None otherwise. """
|
||||
try:
|
||||
if ifname in yaml['vxlan_tunnels']:
|
||||
return yaml['vxlan_tunnels'][ifname]
|
||||
return ifname, yaml['vxlan_tunnels'][ifname]
|
||||
except:
|
||||
pass
|
||||
return None
|
||||
|
Reference in New Issue
Block a user