Fix /session execution

The script now reads arguments correctly.
more_events
Roberto Hueso Gómez 2020-02-05 12:44:58 +01:00 committed by Alvaro Neira Ayuso
parent fe4236dcd8
commit eaba1acbc3
1 changed files with 4 additions and 1 deletions

View File

@ -62,9 +62,12 @@ def execCMD(request, ogRest):
def session(request, ogRest):
disk = request.getDisk()
partition = request.getPartition()
cmd = f'{OG_PATH}interfaceAdm/IniciarSesion {disk} {partition}'
try:
ogRest.proc = subprocess.Popen([OG_PATH + 'interfaceAdm/IniciarSesion', disk, partition], 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')