Commit 2baec036 authored by James Coyle's avatar James Coyle

Merge branch 'tomdev' into 'master'

Couple of bugfixes

See merge request james.coyle/storjalytics-client!1
parents 334e864a 6f82948d
......@@ -49,8 +49,8 @@ def init_send():
'bridgeConnectionStatus': node['bridgeConnectionStatus'],
'reputation': bridge_json['reputation'],
'responseTime': bridge_json['responseTime'],
'lastTimeout': bridge_json['lastTimeout'],
'timeoutRate': bridge_json['timeoutRate'],
'lastTimeout': bridge_json.get('lastTimeout',''),
'timeoutRate': bridge_json.get('timeoutRate',0),
'spaceAvailable': bridge_json['spaceAvailable'],
'lastSeen': bridge_json['lastSeen'],
'rpcAddress': conf_json[node['configPath']]['rpcAddress'],
......@@ -67,7 +67,7 @@ def init_send():
'storjshareVersion': storjshare_version(),
'nodes': json_nodes
}
print(json_request)
print('\nJSON Request...\n'+json.dumps(json_request, indent=4, sort_keys=True))
headers = {'content-type': 'application/json', 'api-key' : APIKEY, 'api-secret' : APISECRET}
try:
resp = requests.post(storjalytics_common.APIENDPOINT + "stats", json=json_request, headers=headers)
......@@ -129,7 +129,7 @@ def config_json():
for root, dirs, filenames in os.walk(STORJCONFIG):
for f in filenames:
# consume config file
with open(os.path.join(root, f), 'r') as f_open:
with open(os.path.join(root, f), 'r', encoding = "ISO-8859-1") as f_open:
print("Parsing config file: " + os.path.join(root, f))
node = {}
f_data = f_open.read()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment