diff --git a/run_rpmlint.py b/run_rpmlint.py --- a/run_rpmlint.py +++ b/run_rpmlint.py @@ -110,9 +110,17 @@ else: outcome = 'ABORTED' + errors = 0 + warnings = 0 match = re.search(r'(\d+) errors, (\d+) warnings', output[-1] if output else '') - errors = int(match.group(1)) - warnings = int(match.group(2)) + if match: + errors = int(match.group(1)) + warnings = int(match.group(2)) + if not match and outcome != 'ABORTED': + errmsg = ('No rpmlint stats on the last line, should not happen. Exit code %d, output:\n%s' + % (proc.returncode, ''.join(output))) + log.critical(errmsg) + assert False, 'No rpmlint stats on the last line' result = Result(outcome=outcome, output=output, errors=errors, warnings=warnings) return result