Browse Source

merge_new_data(): always clear mesh-info fields

Otherwise, the fields 'aliases', 'clients' and 'neighbours' keep
their previous value even though the node went offline.
Helge Jung 9 years ago
parent
commit
c7cb8de292
1 changed files with 3 additions and 2 deletions
  1. 3 2
      ffstatus/basestorage.py

+ 3 - 2
ffstatus/basestorage.py

@@ -94,14 +94,15 @@ class BaseStorage(object):
         current = {}
         for node in self.get_nodes():
             item_id = node['node_id']
-            if not item_id in newdata:
-                continue
 
             current[item_id] = ffstatus.dict_merge(node, {})
             current[item_id]['aliases'] = []
             current[item_id]['clients'] = []
             current[item_id]['neighbours'] = []
 
+            if not item_id in newdata:
+                continue
+
             if not '__RAW__' in current[item_id]:
                 current[item_id]['__RAW__'] = {}