X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fdata%2Fprocessing%2Fping%2Fparser.py;h=c5745a1f52cf33c1b0bc19f8a971fd8f79c99acc;hb=d16b306c7ee05bd2f068966bead8906526368162;hp=0248c8cf8cf2d4142809f6185fae0e97723116fc;hpb=cb816db417dff4d0f985455c1d7cbd261fd40f9b;p=nepi.git diff --git a/src/nepi/data/processing/ping/parser.py b/src/nepi/data/processing/ping/parser.py index 0248c8cf..c5745a1f 100644 --- a/src/nepi/data/processing/ping/parser.py +++ b/src/nepi/data/processing/ping/parser.py @@ -90,6 +90,8 @@ def annotate_cn_graph(logs_dir, graph): 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: @@ -100,10 +102,15 @@ def annotate_cn_graph(logs_dir, graph): 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"])