5
0
mirror of https://github.com/cwinfo/yggdrasil-map synced 2024-11-09 16:00:27 +00:00

Merge pull request #8 from kyrias/sG-fixes

Two additional fixes
This commit is contained in:
Michał Zieliński 2015-11-21 16:28:39 +01:00
commit 573d8260ab

View File

@ -155,8 +155,11 @@ def get_peers(con, path):
break break
if 'result' not in res or res['result'] != 'peers': if 'result' not in res or res['result'] != 'peers':
print('get_peers: failed too many times, skipping.') if 'result' in res and res['result'] == 'timeout':
print(res) print('get_peers: timed out on final try, skipping.')
else:
print('get_peers: failed too many times, skipping. Last response: {:s}'
.format(str(res)))
return peers return peers
for peer in res['peers']: for peer in res['peers']:
@ -208,7 +211,7 @@ def send_graph(nodes, edges):
payload = {'data': json_graph, 'mail': your_mail, 'version': 2} payload = {'data': json_graph, 'mail': your_mail, 'version': 2}
r = requests.post(url, data=payload) r = requests.post(url, data=payload)
if r.content == 'OK': if r.text == 'OK':
print('Done!') print('Done!')
else: else:
print('Error: {:s}'.format(r.text)) print('Error: {:s}'.format(r.text))