Bug fixing the netgraph persistence
[nepi.git] / src / nepi / data / processing / ccn / parser.py
index 9b83a4c..f6452f4 100644 (file)
@@ -199,6 +199,7 @@ def annotate_cn_graph(logs_dir, graph, parse_ping_logs = False):
     """ Adds CCN content history for each node in the topology graph.
 
     """
+    
     # Make a copy of the graph to ensure integrity
     graph = graph.copy()
 
@@ -219,6 +220,10 @@ def annotate_cn_graph(logs_dir, graph, parse_ping_logs = False):
         
         # Each dirpath correspond to a different node
         nid = os.path.basename(dirpath)
+
+        # Cast to numeric nid if necessary
+        if int(nid) in graph.nodes():
+            nid = int(nid)
     
         content_history = dict()