summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-04-20 09:14:52 +0200
committerRoberto Hueso Gómez <rhueso@soleta.eu>2020-04-20 09:14:52 +0200
commitb576836e4331fe8c2e3b92d343af0e2d5670d6c0 (patch)
treef9b380f5bcb3c1e93d0cfe6f3d017a1f6bdcf0d4
parent2e3d47b7b8db69edb5d550ccc4a46fd6512fc031 (diff)
Avoid killing ogclient in virtual mode
-rw-r--r--src/ogRest.py16
1 files 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()