diff options
-rw-r--r-- | src/linux/ogOperations.py | 6 | ||||
-rw-r--r-- | src/ogRest.py | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/linux/ogOperations.py b/src/linux/ogOperations.py index e9592ff..076aa3d 100644 --- a/src/linux/ogOperations.py +++ b/src/linux/ogOperations.py @@ -137,9 +137,13 @@ def image_restore(request, ogRest): ctype = request.getType() profile = request.getProfile() cid = request.getId() + cmd = f'{OG_PATH}interfaceAdm/RestaurarImagen {disk} {partition} ' \ + f'{name} {repo} {ctype}' try: - ogRest.proc = subprocess.Popen([OG_PATH + 'interfaceAdm/RestaurarImagen', disk, partition, name, repo, ctype], stdout=subprocess.PIPE, shell=True) + ogRest.proc = subprocess.Popen([cmd], + stdout=subprocess.PIPE, + shell=True) (output, error) = ogRest.proc.communicate() except: raise ValueError('Error: Incorrect command value') diff --git a/src/ogRest.py b/src/ogRest.py index 0d51d6a..b123505 100644 --- a/src/ogRest.py +++ b/src/ogRest.py @@ -161,6 +161,11 @@ class ogThread(): client.send(response.get()) return + jsonResp = jsonResponse() + jsonResp.addElement('disk', request.getDisk()) + jsonResp.addElement('partition', request.getPartition()) + jsonResp.addElement('image_id', request.getId()) + response = restResponse(ogResponses.OK, jsonResp) client.send(response.get()) |