5
0
mirror of https://github.com/cwinfo/yggdrasil-map synced 2024-12-29 02:55:40 +00:00

Merge pull request #7 from kyrias/sG-fixes

Minor sendGraph fixes
This commit is contained in:
Michał Zieliński 2015-11-21 15:03:24 +01:00
commit 7fd5de8c77

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Based on Kubuxu sendGraph script. Requires Python 3, requests and cjdns.
# Based on Kyrias' sendGraph script. Requires Python 3, requests and cjdns.
# You can install them using pip: pip3 install cjdns requests
###############################################################################
# CONFIG
@ -88,14 +88,13 @@ def connect():
print('Connecting using default or ~/.cjdnsadmin credentials...')
con = cjdns.connectWithAdminInfo()
else:
print('Connecting to port %d...' % (cjdns_port))
print('Connecting to port {:d}...'.format(cjdns_port))
con = cjdns.connect(cjdns_ip, cjdns_port, cjdns_password)
print(admin_tools.whoami(con)['IP'])
return con
except:
print('Failed!')
print('Connection failed!')
print(traceback.format_exc())
sys.exit(1)
@ -212,7 +211,7 @@ def send_graph(nodes, edges):
if r.content == 'OK':
print('Done!')
else:
print('Error: %s' % r.content)
print('Error: {:s}'.format(r.text))
if __name__ == '__main__':
main()