From b576836e4331fe8c2e3b92d343af0e2d5670d6c0 Mon Sep 17 00:00:00 2001 From: Roberto Hueso Gómez Date: Mon, 20 Apr 2020 09:14:52 +0200 Subject: Avoid killing ogclient in virtual mode --- src/ogRest.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ogRest.py b/src/ogRest.py index 4fb2bba..fed998e 100644 --- a/src/ogRest.py +++ b/src/ogRest.py @@ -318,10 +318,10 @@ class ogRest(): response = restResponse(ogResponses.IN_PROGRESS) client.send(response.get()) - client.disconnect() - - if self.state == ThreadState.BUSY: - self.kill_process() + if self.mode != 'virtual': + client.disconnect() + if self.state == ThreadState.BUSY: + self.kill_process() threading.Thread(target=ogThread.reboot, args=(self,)).start() @@ -329,10 +329,10 @@ class ogRest(): response = restResponse(ogResponses.IN_PROGRESS) client.send(response.get()) - client.disconnect() - - if self.state == ThreadState.BUSY: - self.kill_process() + if self.mode != 'virtual': + client.disconnect() + if self.state == ThreadState.BUSY: + self.kill_process() threading.Thread(target=ogThread.poweroff, args=(self,)).start() -- cgit v1.2.3-18-g5258