From fcd43743fb5ba5545c7f0e648e1256ad58ecbdd2 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Fri, 18 Feb 2022 14:44:50 +0100 Subject: [PATCH] rabbit-openqa: Don't crash on openqa jobs without BUILD --- gocd/rabbit-openqa.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gocd/rabbit-openqa.py b/gocd/rabbit-openqa.py index 1f184830..7477d75f 100755 --- a/gocd/rabbit-openqa.py +++ b/gocd/rabbit-openqa.py @@ -215,8 +215,8 @@ class Listener(PubSubConsumer): 'latest': '1', } jobs = self.openqa.openqa_request('GET', 'jobs', values)['jobs'] - # Ignore PR verification runs - return [job for job in jobs if '/' not in job['settings']['BUILD']] + # Ignore PR verification runs (and jobs without 'BUILD') + return [job for job in jobs if '/' not in job['settings'].get('BUILD', '/')] def get_step_url(self, testurl, modulename): failurl = testurl + '/modules/{!s}/fails'.format(quote_plus(modulename))