Browse Source

neighbours field: change from array to dict to include metric

Actually, this is the intended behaviour for a while already but this
bugfix makes this work.
Helge Jung 9 years ago
parent
commit
615d1818f8
2 changed files with 2 additions and 2 deletions
  1. 1 1
      ffstatus/__init__.py
  2. 1 1
      ffstatus/basestorage.py

+ 1 - 1
ffstatus/__init__.py

@@ -83,7 +83,7 @@ def merge_alfred_batman(alfreddata, batmandata):
                     candidates.add(mac2id(mac))
 
         if not 'neighbours' in nodeinfo:
-            nodeinfo['neighbours'] = []
+            nodeinfo['neighbours'] = {}
 
         for candidate_raw in candidates:
             candidate = batlookup[candidate_raw] if candidate_raw in batlookup else candidate_raw

+ 1 - 1
ffstatus/basestorage.py

@@ -100,7 +100,7 @@ class BaseStorage(object):
             current[item_id] = ffstatus.dict_merge(node, {})
             current[item_id]['aliases'] = []
             current[item_id]['clients'] = []
-            current[item_id]['neighbours'] = []
+            current[item_id]['neighbours'] = {}
 
             if not item_id in newdata:
                 continue