summaryrefslogtreecommitdiffstats
path: root/src/ogRest.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/ogRest.py')
-rw-r--r--src/ogRest.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/ogRest.py b/src/ogRest.py
index fe6c0da..ac312f2 100644
--- a/src/ogRest.py
+++ b/src/ogRest.py
@@ -135,16 +135,15 @@ class ogThread():
client.send(response.get())
ogRest.state = ThreadState.IDLE
- def hardware(client, path, ogRest):
+ def hardware(client, ogRest):
try:
- ogRest.operations.hardware(path, ogRest)
+ result = ogRest.operations.hardware(ogRest)
except Exception as e:
ogRest.send_internal_server_error(client, exc=e)
return
json_body = jsonBody()
- with open(path, 'r') as f:
- json_body.add_element('hardware', f.read())
+ json_body.add_element('hardware', result)
response = restResponse(ogResponses.OK, json_body)
client.send(response.get())
@@ -399,8 +398,7 @@ class ogRest():
threading.Thread(target=ogThread.software, args=(client, request, path, self,)).start()
def process_hardware(self, client):
- path = '/tmp/Chrd-' + client.ip
- threading.Thread(target=ogThread.hardware, args=(client, path, self,)).start()
+ threading.Thread(target=ogThread.hardware, args=(client, self,)).start()
def process_schedule(self, client):
response = restResponse(ogResponses.OK)