summaryrefslogtreecommitdiffstats
path: root/src/ogRest.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/ogRest.py')
-rw-r--r--src/ogRest.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/ogRest.py b/src/ogRest.py
index 99ecdbc..5119eea 100644
--- a/src/ogRest.py
+++ b/src/ogRest.py
@@ -106,9 +106,14 @@ class ogThread():
ogOperations.procsetup(httpparser)
# Process image restore
- def procirestore(msgqueue, httpparser):
- msgqueue.queue.clear()
- msgqueue.put(ogOperations.procirestore(httpparser))
+ def procirestore(httpparser):
+ try:
+ ogOperations.procirestore(httpparser)
+ except ValueError as err:
+ client.send(restResponse.getResponse(ogResponses.INTERNAL_ERR))
+ return
+
+ client.send(restResponse.getResponse(ogResponses.OK))
class ogResponses(Enum):
BAD_REQUEST=0
@@ -211,5 +216,4 @@ class ogRest():
client.send(restResponse.getResponse(ogResponses.OK))
def process_irestore(self, client, httpparser):
- threading.Thread(target=ogThread.procirestore, args=(self.msgqueue, httpparser,)).start()
- client.send(restResponse.getResponse(ogResponses.OK))
+ threading.Thread(target=ogThread.procirestore, args=(client, httpparser,)).start()