diff --git a/source/server/apistatusd.py b/source/server/apistatusd.py index 2f97f1b..04ad48c 100755 --- a/source/server/apistatusd.py +++ b/source/server/apistatusd.py @@ -155,11 +155,11 @@ def set_values(raw_data): param 1: byte return: tuple ''' - status = "true" if raw_data == b'\x01' else "false" - timestamp = str(time()).split('.')[0] + status = True if raw_data == b'\x01' else False + timestamp = int(str(time()).split('.')[0]) logging.debug('Set values for timestamp: {} and status: {}'.format( - timestamp, status)) + str(timestamp), str(status))) return (status, timestamp) @@ -235,7 +235,7 @@ def main(): logging.debug('Socket created') mySocket.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) keep = mySocket.getsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE) - logging.debug('Socket keepalive: {}'format(keep)) + logging.debug('Socket keepalive: {}'.format(keep)) try: mySocket.bind((config['server']['host'], int(config['server']['port']))) mySocket.listen(5)