Added a mac->iface lookup function, just to make the templte codes easier to read.

This commit is contained in:
Anton Hvornum 2020-11-29 21:36:15 +00:00
parent 07e6e91f3c
commit 5470434097
1 changed files with 3 additions and 0 deletions

View File

@ -18,3 +18,6 @@ def list_interfaces(skip_loopback=True):
mac = getHwAddr(iface).replace(':', '-').lower()
interfaces[mac] = iface
return interfaces
def get_interface_from_mac(mac):
return list_interfaces().get(mac, None)