From 65418d4cb28d1f9979e5fdf34f771f5bb6a3d216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez?= Date: Fri, 29 Aug 2014 09:35:30 +0000 Subject: [PATCH] Fixed UDS Actor to check --- linuxActor/src/actor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/linuxActor/src/actor.py b/linuxActor/src/actor.py index 053dc3d3b..4c72a9eb9 100644 --- a/linuxActor/src/actor.py +++ b/linuxActor/src/actor.py @@ -6,7 +6,7 @@ Created on Nov 16, 2011 @author: dkmaster ''' -import sys, time, logging +import sys, time, logging, re from uds.actor.daemon import Daemon from uds.actor.rpc import Rpc from uds.actor import net @@ -16,6 +16,7 @@ logger = logging.getLogger('uds') class MyDaemon(Daemon): def run(self): + splitRe = re.compile('\r|\n') while True: # Wait for networks to become ready info = net.getExternalIpAndMacs() @@ -34,7 +35,7 @@ class MyDaemon(Daemon): time.sleep(4) # We can get 'rename:newname', ''. Anything else is an error - data = todo.split('\r') + data = splitRe.split(todo) if data[0] == 'rename': logger.info('Renaming to {0}'.format(data[1]))