From bb79df7985c1ada7bfe9bdc18450e4023c5e9ff9 Mon Sep 17 00:00:00 2001 From: Vanhala Antti Date: Sun, 30 Mar 2014 21:03:24 +0300 Subject: [PATCH] Don't crash if connecting fails --- mapper/makeGraph.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mapper/makeGraph.py b/mapper/makeGraph.py index 03c6b96..a7e5055 100755 --- a/mapper/makeGraph.py +++ b/mapper/makeGraph.py @@ -50,10 +50,15 @@ for port in range(rpc_firstport, rpc_firstport + num_of_nodes): print port, these_nodes = dict() these_edges = [] - cjdns = admin.connect(rpc_connect, port, rpc_pw) - root = admin.whoami(cjdns) - rootIP = root['IP'] - print rootIP + + try: + cjdns = admin.connect(rpc_connect, port, rpc_pw) + root = admin.whoami(cjdns) + rootIP = root['IP'] + print rootIP + except: + print 'Connecting failed.' + continue add_node(Node(rootIP))