Fix gerrit leave comment capability

When adding support for short build_uuid's in
AI6356a971ca250ddf5f01a9734f13d0b080a62c89 event.bugs was converted to a
set since we would know can run classify multiple times on a singe
event and don't want duplicate bugs. That patch didn't update the gerrit
leave comment capabilties to understand event.bugs as a set (instead of
a list).

Change-Id: I9032e23e0e53426a57bebf42f4c4d4167624280e
This commit is contained in:
Joe Gordon 2014-01-25 18:32:09 -08:00
parent ad52b4e86a
commit fc468e4d4c
2 changed files with 5 additions and 5 deletions

View File

@ -265,7 +265,7 @@ For a code review which has been approved but failed to merge,
you can reverify by leaving a comment like this: you can reverify by leaving a comment like this:
reverify bug %(bug)s""" % {'bugs': "\n- ".join(bug_urls), reverify bug %(bug)s""" % {'bugs': "\n- ".join(bug_urls),
'bug': bugs[0]} 'bug': list(bugs)[0]}
else: else:
message = ("I noticed tempest failed, refer to: " message = ("I noticed tempest failed, refer to: "
"https://wiki.openstack.org/wiki/" "https://wiki.openstack.org/wiki/"

View File

@ -33,7 +33,7 @@ class TestGerritComment(testtools.TestCase):
self.gerrit = gerritlib.gerrit.Gerrit(host, self.user, port) self.gerrit = gerritlib.gerrit.Gerrit(host, self.user, port)
def test_bug_found(self): def test_bug_found(self):
bug_numbers = ['1223158'] bug_numbers = set(['1223158'])
project = 'gtest-org/test' project = 'gtest-org/test'
commit_id = '434,1' commit_id = '434,1'
commit = '434' commit = '434'
@ -47,10 +47,10 @@ class TestGerritComment(testtools.TestCase):
comment.get('message')) comment.get('message'))
def test_bugs_found(self): def test_bugs_found(self):
bug_numbers = ['1223158', '424242'] bug_numbers = set(['1223158', '424242'])
project = 'gtest-org/test' project = 'gtest-org/test'
commit_id = '434,1' commit_id = '781,1'
commit = '434' commit = '781'
self.stream.leave_comment(project, commit_id, bug_numbers) self.stream.leave_comment(project, commit_id, bug_numbers)
result = self.gerrit.query(commit, comments=True) result = self.gerrit.query(commit, comments=True)
comments = result.get('comments') comments = result.get('comments')