diff options
author | Roberto Hueso Gómez <rhueso@soleta.eu> | 2020-02-05 12:39:04 +0100 |
---|---|---|
committer | Alvaro Neira Ayuso <aneira@soleta.eu> | 2020-02-05 13:41:54 +0100 |
commit | 680214317eef44f86d99d329f886e56743596def (patch) | |
tree | 70cc33ab9ee136ba673257f54abf0a08ae359ab3 /src/ogRest.py | |
parent | 834f5cd5c23162d82308a9aa74cb1de97fa568e2 (diff) |
Fix /image/create execution and response
Diffstat (limited to 'src/ogRest.py')
-rw-r--r-- | src/ogRest.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/ogRest.py b/src/ogRest.py index 7606d8b..0d51d6a 100644 --- a/src/ogRest.py +++ b/src/ogRest.py @@ -113,7 +113,6 @@ class ogThread(): return jsonResp = jsonResponse() - jsonResp.addElement('disk', request.getDisk()) jsonResp.addElement('partition', request.getPartition()) f = open(path, "r") @@ -180,10 +179,8 @@ class ogThread(): jsonResp.addElement('id', request.getId()) jsonResp.addElement('name', request.getName()) jsonResp.addElement('repository', request.getRepo()) - f = open(path, "r") - lines = f.readlines() - f.close() - jsonResp.addElement('software', lines[0]) + with open(path, 'r') as f: + jsonResp.addElement('software', f.read()) response = restResponse(ogResponses.OK, jsonResp) client.send(response.get()) |