diff options
author | Roberto Hueso Gómez <rhueso@soleta.eu> | 2020-01-31 13:19:41 +0100 |
---|---|---|
committer | Alvaro Neira Ayuso <aneira@soleta.eu> | 2020-02-03 10:15:54 +0100 |
commit | 2934773d88c0ced60dafa365370871b29c5ba3a1 (patch) | |
tree | 61083b6cbeb641d8f9124203014ac49518ab53eb /src/ogRest.py | |
parent | e96e187825ad4e03904b23697215a1bb58bfe3f0 (diff) |
Fix /setup execution and response
Diffstat (limited to 'src/ogRest.py')
-rw-r--r-- | src/ogRest.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/ogRest.py b/src/ogRest.py index 6fb0dc0..7606d8b 100644 --- a/src/ogRest.py +++ b/src/ogRest.py @@ -142,20 +142,14 @@ class ogThread(): client.send(response.get()) def setup(client, request, ogRest): - listconfig = [] - try: - listconfig = ogOperations.setup(request, ogRest) + out = ogOperations.setup(request, ogRest) except ValueError as err: response = restResponse(ogResponses.INTERNAL_ERR) client.send(response.get()) return - jsonResp = jsonResponse() - jsonResp.addElement('disk', request.getDisk()) - jsonResp.addElement('cache', request.getCache()) - jsonResp.addElement('cache_size', request.getCacheSize()) - jsonResp.addElement('partition_setup', listconfig) + jsonResp = jsonResponse(out) response = restResponse(ogResponses.OK, jsonResp) client.send(response.get()) |