mirror of https://git.48k.eu/ogclient
Fix /image/restore execution and response
parent
680214317e
commit
fe4236dcd8
|
@ -137,9 +137,13 @@ def image_restore(request, ogRest):
|
||||||
ctype = request.getType()
|
ctype = request.getType()
|
||||||
profile = request.getProfile()
|
profile = request.getProfile()
|
||||||
cid = request.getId()
|
cid = request.getId()
|
||||||
|
cmd = f'{OG_PATH}interfaceAdm/RestaurarImagen {disk} {partition} ' \
|
||||||
|
f'{name} {repo} {ctype}'
|
||||||
|
|
||||||
try:
|
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()
|
(output, error) = ogRest.proc.communicate()
|
||||||
except:
|
except:
|
||||||
raise ValueError('Error: Incorrect command value')
|
raise ValueError('Error: Incorrect command value')
|
||||||
|
|
|
@ -161,6 +161,11 @@ class ogThread():
|
||||||
client.send(response.get())
|
client.send(response.get())
|
||||||
return
|
return
|
||||||
|
|
||||||
|
jsonResp = jsonResponse()
|
||||||
|
jsonResp.addElement('disk', request.getDisk())
|
||||||
|
jsonResp.addElement('partition', request.getPartition())
|
||||||
|
jsonResp.addElement('image_id', request.getId())
|
||||||
|
|
||||||
response = restResponse(ogResponses.OK, jsonResp)
|
response = restResponse(ogResponses.OK, jsonResp)
|
||||||
client.send(response.get())
|
client.send(response.get())
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue