Commit 405bd4d1 authored by Timothy Stack's avatar Timothy Stack

Fix the experiment.info() method so that it properly handles requests

for the "links" aspect in experiments with no links.
parent 3312f75c
...@@ -1049,8 +1049,10 @@ class experiment: ...@@ -1049,8 +1049,10 @@ class experiment:
ipmap = {} ipmap = {}
for res in dbres: for res in dbres:
for ipinfo in string.split(res[1], " "): for ipinfo in string.split(res[1], " "):
port, ip = string.split(ipinfo, ":") if len(ipinfo) > 0:
ipmap[res[0] + ":" + port] = ip port, ip = string.split(ipinfo, ":")
ipmap[res[0] + ":" + port] = ip
pass
pass pass
pass pass
...@@ -1060,19 +1062,21 @@ class experiment: ...@@ -1060,19 +1062,21 @@ class experiment:
"order by vname,member", "order by vname,member",
(argdict["proj"], argdict["exp"])) (argdict["proj"], argdict["exp"]))
for res in dbres: if len(dbres) > 0:
tmp = {} for res in dbres:
tmp["name"] = res[0] tmp = {}
tmp["member"] = res[1] tmp["name"] = res[0]
tmp["ipaddr"] = ipmap[res[1]] tmp["member"] = res[1]
tmp["mask"] = res[2] tmp["ipaddr"] = ipmap[res[1]]
tmp["delay"] = res[3] tmp["mask"] = res[2]
tmp["bandwidth"] = int(res[4]) tmp["delay"] = res[3]
tmp["plr"] = res[5] tmp["bandwidth"] = int(res[4])
tmp["r_delay"] = res[6] tmp["plr"] = res[5]
tmp["r_bandwidth"] = int(res[7]) tmp["r_delay"] = res[6]
tmp["r_plr"] = res[8] tmp["r_bandwidth"] = int(res[7])
result[res[1]] = tmp tmp["r_plr"] = res[8]
result[res[1]] = tmp
pass
pass pass
pass pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment