diff options
author | makefu <root@pigstarter.de> | 2013-06-25 11:17:41 +0200 |
---|---|---|
committer | makefu <root@pigstarter.de> | 2013-06-25 11:17:41 +0200 |
commit | c82ed681c963f4b3ae5cf1218c58b93413695108 (patch) | |
tree | 451aaf221321102f471905682fb24c774425fc87 /retiolum/scripts/adv_graphgen/tinc_stats/Graph.py | |
parent | 1c299194ecd5e91f6f9915582c2b1d6ce0e80b5b (diff) |
add function to add jitter to coordinates to avoid overlaying of points on the map
Diffstat (limited to 'retiolum/scripts/adv_graphgen/tinc_stats/Graph.py')
-rw-r--r-- | retiolum/scripts/adv_graphgen/tinc_stats/Graph.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/retiolum/scripts/adv_graphgen/tinc_stats/Graph.py b/retiolum/scripts/adv_graphgen/tinc_stats/Graph.py index da0ed828..18c3d545 100644 --- a/retiolum/scripts/adv_graphgen/tinc_stats/Graph.py +++ b/retiolum/scripts/adv_graphgen/tinc_stats/Graph.py @@ -7,6 +7,18 @@ from Availability import get_node_availability import sys,json from time import time DUMP_FILE = "/krebs/db/availability" + + +def resolve_myself(nodes): + #resolve MYSELF to the real ip + for k,v in nodes.iteritems(): + if v["external-ip"] == "MYSELF": + for nodek,node in nodes.iteritems(): + for to in node['to']: + if to['name'] == k: + v["external-ip"] = to["addr"] + return nodes + def dump_graph(nodes): from time import time graph = {} |