From 5603a280ef042b9ec0993ffa79f289aa2b2a9980 Mon Sep 17 00:00:00 2001 From: Alvaro Neira Ayuso Date: Fri, 17 Jan 2020 19:32:20 +0100 Subject: Improve /image/create command response With this new patch, the image/create command will create a response message with more information for the server. The new format is: {"disk" : "1", "partition" : "1", "code" : "1", "id" : "1", "name" : "test", "repository" : "192.168.2.4", "software" : "xyz"} "xyz" will be the output saved during the execution of InventarioSoftware in a specific path. --- src/ogRest.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/ogRest.py') diff --git a/src/ogRest.py b/src/ogRest.py index dfd2930..2e5c7a7 100644 --- a/src/ogRest.py +++ b/src/ogRest.py @@ -159,6 +159,13 @@ class ogThread(): client.send(restResponse.getResponse(ogResponses.INTERNAL_ERR)) return + jsonResp = jsonResponse() + jsonResp.addElement('disk', httpparser.getDisk()) + jsonResp.addElement('partition', httpparser.getPartition()) + jsonResp.addElement('code', httpparser.getCode()) + jsonResp.addElement('id', httpparser.getId()) + jsonResp.addElement('name', httpparser.getName()) + jsonResp.addElement('repository', httpparser.getRepo()) f = open(path, "r") lines = f.readlines() f.close() -- cgit v1.2.3-18-g5258