diff options
author | Linus Lüssing <linus.luessing@web.de> | 2014-05-02 04:08:23 +0200 |
---|---|---|
committer | Linus Lüssing <linus.luessing@web.de> | 2014-05-02 04:10:39 +0200 |
commit | 605765cd12036a58785aa7098b524ee93beca523 (patch) | |
tree | 3c7ad6da4ec4a6f9d31478113222cfeebd608177 | |
parent | ac3366ff13f9cf71452d50aa6d2263f07a81c26c (diff) |
try non-fuzzy prior fuzzy mac matching
Fuzzy matching should only be tried if there's no exact match. Otherwise
a node in the map might get the wrong label.
-rw-r--r-- | nodedb.py | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -169,12 +169,15 @@ class NodeDB: def import_aliases(self, aliases): for mac, alias in aliases.items(): try: - node = self.maybe_node_by_fuzzy_mac(mac) + node = self.maybe_node_by_mac([mac]) except: - # create an offline node - node = Node() - node.add_mac(mac) - self._nodes.append(node) + try: + node = self.maybe_node_by_fuzzy_mac(mac) + except: + # create an offline node + node = Node() + node.add_mac(mac) + self._nodes.append(node) if 'name' in alias: node.name = alias['name'] |