Merge pull request #846 from jberry-suse/reviewbot-always-remove-comment

ReviewBot: always remove previous comment regardless of the state.
This commit is contained in:
Jimmy Berry 2017-04-26 12:02:14 -05:00 committed by GitHub
commit ae280be3de

View File

@ -412,6 +412,9 @@ class ReviewBot(object):
self.logger.debug('adding comment to {}: {}'.format(request.reqid, message))
if not self.dryrun:
if comment is None:
# Broaden search to include any comment state.
comment, _ = self.comment_api.comment_find(comments, self.bot_name)
if comment is not None:
self.comment_api.delete(comment['id'])
self.comment_api.add_comment(request_id=request.reqid, comment=str(message))