From b7e9b977884f8d4d6149b06e3567f288b920daa6 Mon Sep 17 00:00:00 2001 From: Felix Richter Date: Sun, 29 May 2011 12:25:46 +0200 Subject: updated graphgen script parse.py: parser now stores all internal addresses for nodes which have v4 and v6 addresses --- modules/retiolum/scripts/adv_graphgen/parse.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'modules/retiolum/scripts/adv_graphgen/parse.py') diff --git a/modules/retiolum/scripts/adv_graphgen/parse.py b/modules/retiolum/scripts/adv_graphgen/parse.py index 16d3043b..639c5316 100755 --- a/modules/retiolum/scripts/adv_graphgen/parse.py +++ b/modules/retiolum/scripts/adv_graphgen/parse.py @@ -51,8 +51,9 @@ def write_node(k,v): node += "external:"+v['external-ip']+":"+v['external-port']+"\\l" if v.has_key('num_conns'): node += "Num Connects:"+str(v['num_conns'])+"\\l" - - node += "internal:"+v.get('internal-ip','¯\\\\(°_o)/¯')+"\\l\"" + for addr in v.get('internal-ip',['¯\\\\(°_o)/¯']): + node += "internal:"+addr+"\\l" + node +="\"" if v['external-ip'] == "MYSELF": node += ",fillcolor=steelblue1" node += "]" @@ -81,7 +82,9 @@ def parse_input(): if line == 'End of subnet list.\n': break l = line.replace('\n','').split() - nodes[l[2]]['internal-ip'] = l[0].split('#')[0] + if not nodes[l[2]].get('internal-ip',False): + nodes[l[2]]['internal-ip'] = [] + nodes[l[2]]['internal-ip'].append(l[0].split('#')[0]) if line == 'Edges:': edges = {} for line in sys.stdin: -- cgit v1.2.3