From 3b8540639638a0dbde9522c75780d74c0fd4efd3 Mon Sep 17 00:00:00 2001 From: Jimmy Berry Date: Mon, 10 Jul 2017 17:53:25 -0500 Subject: [PATCH] repo_checker: handle corrupted requests referencing non-existent projects. --- repo_checker.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/repo_checker.py b/repo_checker.py index e7824932..0e83c533 100755 --- a/repo_checker.py +++ b/repo_checker.py @@ -66,7 +66,9 @@ class RepoChecker(ReviewBot.ReviewBot): # Only interested if group has completed building. api = self.staging_api(request.actions[0].tgt_project) status = api.project_status(group, True) - if str(status['overall_state']) not in ('testing', 'review', 'acceptable'): + # Corrupted requests may reference non-existent projects and will + # thus return a None status which should be considered not ready. + if not status or str(status['overall_state']) not in ('testing', 'review', 'acceptable'): self.logger.debug('{}: {} not ready'.format(request.reqid, group)) continue