mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-12 15:52:07 +02:00
processGraph: check return code of the subprocess
This commit is contained in:
parent
ff2a65685c
commit
f54c765b30
1 changed files with 9 additions and 2 deletions
|
@ -367,11 +367,18 @@ class Node:
|
||||||
statThread = StatisticsThread(self)
|
statThread = StatisticsThread(self)
|
||||||
statThread.start()
|
statThread.start()
|
||||||
try:
|
try:
|
||||||
|
returnCode = 1
|
||||||
with open(self.logFile(), 'w') as logF:
|
with open(self.logFile(), 'w') as logF:
|
||||||
cmd = self.commandLine()
|
cmd = self.commandLine()
|
||||||
print(' =====> commandLine: ', cmd)
|
print('\n =====> commandLine:\n', cmd, '\n')
|
||||||
print(' - logFile: ', self.logFile())
|
print(' - logFile: ', self.logFile())
|
||||||
subprocess.call(cmd, stdout=logF, stderr=logF, shell=True)
|
returnCode = subprocess.call(cmd, stdout=logF, stderr=logF, shell=True)
|
||||||
|
if returnCode != 0:
|
||||||
|
logContent = ''
|
||||||
|
with open(self.logFile(), 'r') as logF:
|
||||||
|
logContent = ''.join(logF.readlines())
|
||||||
|
self.upgradeStatusTo(pg.Status.ERROR)
|
||||||
|
raise RuntimeError('Error on node "{}":\nLog:\n{}'.format(self.name, logContent))
|
||||||
except:
|
except:
|
||||||
self.upgradeStatusTo(pg.Status.ERROR)
|
self.upgradeStatusTo(pg.Status.ERROR)
|
||||||
raise
|
raise
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue