aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNils Schneider <nils@nilsschneider.net>2014-08-17 19:10:32 +0200
committerNils Schneider <nils@nilsschneider.net>2014-08-17 19:10:32 +0200
commita5cb5f0fdb0c53d7ef6d84ee2b2154e09ab27fe7 (patch)
treeb9cb3344919653109ed8447e2d66d6afc5582154
parent0d71de7091711ec4838c797c17c65b23454078c3 (diff)
remove fuzzy matching
-rw-r--r--nodedb.py21
1 files changed, 4 insertions, 17 deletions
diff --git a/nodedb.py b/nodedb.py
index b41f917..a45c7a1 100644
--- a/nodedb.py
+++ b/nodedb.py
@@ -56,16 +56,6 @@ class NodeDB:
except:
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):
for node in self._nodes:
for mac in macs:
@@ -207,13 +197,10 @@ class NodeDB:
try:
node = self.maybe_node_by_mac([mac])
except:
- try:
- node = self.maybe_node_by_fuzzy_mac(mac)
- except:
- # create an offline node
- node = Node()
- node.add_mac(mac)
- self._nodes.append(node)
+ # create an offline node
+ node = Node()
+ node.add_mac(mac)
+ self._nodes.append(node)
if 'name' in alias:
node.name = alias['name']