From f5f2f8aa9b4508ca7ee48af8eb720e30adaa8a10 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Fri, 11 Mar 2016 14:02:00 +0530 Subject: [PATCH] Only ping buildbot if it exists --- homu/main.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/homu/main.py b/homu/main.py index a0f0f703..8a1ec4c9 100644 --- a/homu/main.py +++ b/homu/main.py @@ -379,11 +379,12 @@ def parse_commands(body, username, repo_cfg, state, my_username, db, states, *, state.save() elif word == 'force' and realtime: - with buildbot_sess(repo_cfg) as sess: - res = sess.post(repo_cfg['buildbot']['url'] + '/builders/_selected/stopselected', allow_redirects=False, data={ - 'selected': repo_cfg['buildbot']['builders'], - 'comments': INTERRUPTED_BY_HOMU_FMT.format(int(time.time())), - }) + if 'buildbot' in repo_cfg: + with buildbot_sess(repo_cfg) as sess: + res = sess.post(repo_cfg['buildbot']['url'] + '/builders/_selected/stopselected', allow_redirects=False, data={ + 'selected': repo_cfg['buildbot']['builders'], + 'comments': INTERRUPTED_BY_HOMU_FMT.format(int(time.time())), + }) if 'authzfail' in res.text: err = 'Authorization failed'