remove fuzzy matching
parent
0d71de7091
commit
a5cb5f0fdb
21
nodedb.py
21
nodedb.py
|
@ -56,16 +56,6 @@ class NodeDB:
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def maybe_node_by_fuzzy_mac(self, mac):
|
|
||||||
mac_a = mac.lower()
|
|
||||||
|
|
||||||
for node in self._nodes:
|
|
||||||
for mac_b in node.macs:
|
|
||||||
if is_derived_mac(mac_a, mac_b):
|
|
||||||
return node
|
|
||||||
|
|
||||||
raise KeyError
|
|
||||||
|
|
||||||
def maybe_node_by_mac(self, macs):
|
def maybe_node_by_mac(self, macs):
|
||||||
for node in self._nodes:
|
for node in self._nodes:
|
||||||
for mac in macs:
|
for mac in macs:
|
||||||
|
@ -207,13 +197,10 @@ class NodeDB:
|
||||||
try:
|
try:
|
||||||
node = self.maybe_node_by_mac([mac])
|
node = self.maybe_node_by_mac([mac])
|
||||||
except:
|
except:
|
||||||
try:
|
# create an offline node
|
||||||
node = self.maybe_node_by_fuzzy_mac(mac)
|
node = Node()
|
||||||
except:
|
node.add_mac(mac)
|
||||||
# create an offline node
|
self._nodes.append(node)
|
||||||
node = Node()
|
|
||||||
node.add_mac(mac)
|
|
||||||
self._nodes.append(node)
|
|
||||||
|
|
||||||
if 'name' in alias:
|
if 'name' in alias:
|
||||||
node.name = alias['name']
|
node.name = alias['name']
|
||||||
|
|
Loading…
Reference in New Issue