Make the meetbot SAR script more resilient

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
Pierre-Yves Chibon
2018-05-22 10:43:01 +02:00
parent 8a608cd880
commit 8a432d355d

View File

@@ -32,7 +32,13 @@ def main():
os.chdir(_logs_folder)
def _grep_and_process(command):
cli_out = subprocess.check_output(command).decode('utf-8')
cli_out = ''
try:
cli_out = subprocess.check_output(command).decode('utf-8')
except subprocess.CalledProcessError as err:
if err.output:
print('ERROR: command: %s returned: %s' % (command, err.returncode))
print('ERROR: output: %s' % (err.output))
lines = cli_out.split('\n')
for line in lines:
if line.startswith('./'):