From b2f24e72a1f16790a37869b445093df258c363f7 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 22 Oct 2013 16:28:54 -0400 Subject: [PATCH] Fix irc message for multiple bugs found This commit is basically the dual of change: Iaf28dbe9909c60b1e2206a79faaf5190f792252d which fixed the gerrit message when multiple bugs were identified. This just does the same thing for the irc messages too, which were overlooked in the other patch. Change-Id: Ic446d9a1568b4b017455f85ce78b192910904b47 --- elastic_recheck/bot.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/elastic_recheck/bot.py b/elastic_recheck/bot.py index 0313e79f..41185d33 100755 --- a/elastic_recheck/bot.py +++ b/elastic_recheck/bot.py @@ -117,12 +117,9 @@ class RecheckWatch(threading.Thread): msg = ('%s change: %s failed tempest because of:' % ( data['change']['project'], data['change']['url'])) - if len(data['bug_numbers']) > 1: - for bug in data['bug_numbers']: - msg += ' https://bugs.launchpad.net/bugs/%s and' % bug - else: - msg += (' https://bugs.launchpad.net/bugs/%s' % - data['bug_numbers'][0]) + bug_urls = ['https://bugs.launchpad.net/bugs/%s' % x for x + in data['bug_numbers']] + msg += ' and '.join(bug_urls) self.log.info('Compiled Message %s: %s' % (channel, msg)) self.ircbot.send(channel, msg)