summaryrefslogtreecommitdiffstats
path: root/src/ogRest.py
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-01-31 13:17:24 +0100
committerAlvaro Neira Ayuso <aneira@soleta.eu>2020-02-03 10:15:49 +0100
commite96e187825ad4e03904b23697215a1bb58bfe3f0 (patch)
tree34e00beec791ce297d3f57b692c0a60a3148c311 /src/ogRest.py
parentf86999da0c150d2a6976ba69a352164b55c52639 (diff)
Fix parseGetConf(...) configuration parsing
This patch also reformats the response to the /refresh command.
Diffstat (limited to 'src/ogRest.py')
-rw-r--r--src/ogRest.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ogRest.py b/src/ogRest.py
index f9913c8..6fb0dc0 100644
--- a/src/ogRest.py
+++ b/src/ogRest.py
@@ -22,8 +22,11 @@ if platform.system() == 'Linux':
from src.linux import ogOperations
class jsonResponse():
- def __init__(self):
- self.jsontree = {}
+ def __init__(self, dictionary=None):
+ if dictionary:
+ self.jsontree = dictionary
+ else:
+ self.jsontree = {}
def addElement(self, key, value):
self.jsontree[key] = value
@@ -199,9 +202,7 @@ class ogThread():
client.send(response.get())
return
- jsonResp = jsonResponse()
- jsonResp.addElement('disk', out[0])
- jsonResp.addElement('partition_setup', out[1])
+ jsonResp = jsonResponse(out)
response = restResponse(ogResponses.OK, jsonResp)
client.send(response.get())