From 50628cdbf629bf9604f1b602873394b686678fdb Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 13 Jun 2012 16:58:40 -0700 Subject: [PATCH] Try again to fix the close request script. Fixes bug #1012310 Seems github won't let you request an issue if issues are disabled on a repo. So attempt to get around this by creating an Issue object derived from a pull requests URL. Then comment on this issue object. Change-Id: If64640ebc1d86d86360e5657f4245541620fcebb --- modules/gerrit/files/scripts/close_pull_requests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/gerrit/files/scripts/close_pull_requests.py b/modules/gerrit/files/scripts/close_pull_requests.py index 245bbcc747..202d2eb7a7 100755 --- a/modules/gerrit/files/scripts/close_pull_requests.py +++ b/modules/gerrit/files/scripts/close_pull_requests.py @@ -89,6 +89,7 @@ for section in config.sections(): pull_requests = repo.get_pulls("open") for req in pull_requests: vars = dict(project=project) - issue = repo.get_issue(req.number) + issue_data = {"url": repo.url + "/issues/" + str(req.number)} + issue = github.Issue.Issue(req._requester, issue_data, completed = True) issue.create_comment(MESSAGE % vars) req.edit(state = "closed")