summaryrefslogtreecommitdiffstats
path: root/retiolum/scripts/adv_graphgen/tinc_stats/Graph.py
diff options
context:
space:
mode:
Diffstat (limited to 'retiolum/scripts/adv_graphgen/tinc_stats/Graph.py')
-rw-r--r--retiolum/scripts/adv_graphgen/tinc_stats/Graph.py12
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 = {}