To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 490ba44a authored by Reto Da Forno's avatar Reto Da Forno

bytestring in serial output fixed

parent a0c24d6a
......@@ -166,7 +166,11 @@ def convert_gpio_monitor(obsdata, observer_id, node_id):
return "%s,%s,%s,%s,%s\n" %(obsdata[2], observer_id, node_id, pindict[obsdata[0]][0], obsdata[1])
def convert_serial(obsdata, observer_id, node_id):
return "%s,%s,%s,%s,%s\n" %(obsdata[2], observer_id, node_id, serialdict[obsdata[0]], obsdata[1])
try:
result = "%s,%s,%s,%s,%s\n" %(obsdata[2], observer_id, node_id, serialdict[obsdata[0]], obsdata[1].decode('utf8'))
except UnicodeDecodeError:
result = "%s,%s,%s,%s,%s\n" %(obsdata[2], observer_id, node_id, serialdict[obsdata[0]], str(obsdata[1]))
return result
def convert_error_log(obsdata, observer_id, node_id):
return "%s,%s,%s,%s\n" %(obsdata[2], observer_id, node_id, obsdata[1])
......
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