ips2nid[ip] = nid
# Walk through the ping logs...
+ found_files = False
+
for dirpath, dnames, fnames in os.walk(logs_dir):
# continue if we are not at the leaf level (if there are subdirectories)
if dnames:
for fname in fnames:
if fname.endswith(".ping"):
+ found_files = True
filename = os.path.join(dirpath, fname)
data = parse_file(filename)
annotate_cn_node(graph, nid, ips2nid, data)
+ if not found_files:
+ msg = "No PING output files were found to parse at %s " % logs_dir
+ raise RuntimeError, msg
+
# Take as weight the most frequent value
for nid1, nid2 in graph.edges():
delays = collections.Counter(graph.edge[nid1][nid2]["delays"])