From e9e96604c5bc7a6780ab7e4cab585a9a368d51ef Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Wed, 13 Dec 2017 14:29:15 -0800 Subject: [PATCH] autotests: fix issue with hlrauc reading sim database hlrauc.py was not stripping out newlines when reading the sim database files. Also added a print if an exception occurred. --- autotests/util/hlrauc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autotests/util/hlrauc.py b/autotests/util/hlrauc.py index ea8d2297..98edcae3 100644 --- a/autotests/util/hlrauc.py +++ b/autotests/util/hlrauc.py @@ -31,7 +31,10 @@ class AuthCenter: data, addr = self._socket.recvfrom(1000) data = data.decode('ascii') resp = self._process_data(data) + except BlockingIOError: + continue except: + print("Exception:", sys.exc_info()[0]) continue if resp: self._socket.sendto(bytearray(resp, 'UTF-8'), addr) @@ -43,7 +46,7 @@ class AuthCenter: if line[0] == '#': continue else: - data = line.split(':') + data = line.strip('\n').split(':') self._database[data[0]] = data[1:] def _process_data(self, data):