summaryrefslogtreecommitdiffstats
path: root/src/linux
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-02-05 12:39:04 +0100
committerAlvaro Neira Ayuso <aneira@soleta.eu>2020-02-05 13:41:54 +0100
commit680214317eef44f86d99d329f886e56743596def (patch)
tree70cc33ab9ee136ba673257f54abf0a08ae359ab3 /src/linux
parent834f5cd5c23162d82308a9aa74cb1de97fa568e2 (diff)
Fix /image/create execution and response
Diffstat (limited to 'src/linux')
-rw-r--r--src/linux/ogOperations.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/linux/ogOperations.py b/src/linux/ogOperations.py
index e941864..e9592ff 100644
--- a/src/linux/ogOperations.py
+++ b/src/linux/ogOperations.py
@@ -151,9 +151,15 @@ def image_create(path, request, ogRest):
partition = request.getPartition()
name = request.getName()
repo = request.getRepo()
+ cmd_software = f'{OG_PATH}interfaceAdm/InventarioSoftware {disk} ' \
+ f'{partition} {path}'
+ cmd_create_image = f'{OG_PATH}interfaceAdm/CrearImagen {disk} ' \
+ f'{partition} {name} {repo}'
try:
- ogRest.proc = subprocess.Popen([OG_PATH + 'interfaceAdm/InventarioSoftware', disk, partition, path], stdout=subprocess.PIPE, shell=True)
+ ogRest.proc = subprocess.Popen([cmd_software],
+ stdout=subprocess.PIPE,
+ shell=True)
(output, error) = ogRest.proc.communicate()
except:
raise ValueError('Error: Incorrect command value')
@@ -162,7 +168,9 @@ def image_create(path, request, ogRest):
return
try:
- ogRest.proc = subprocess.Popen([OG_PATH + 'interfaceAdm/CrearImagen', disk, partition, name, repo], stdout=subprocess.PIPE, shell=True)
+ ogRest.proc = subprocess.Popen([cmd_create_image],
+ stdout=subprocess.PIPE,
+ shell=True)
ogRest.proc.communicate()
except:
raise ValueError('Error: Incorrect command value')