Created
February 12, 2015 17:49
-
-
Save dims/2ba347b79da3ccdc882a to your computer and use it in GitHub Desktop.
Scan the Nova "In Progress" Launchpad bugs for abandoned reviews
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from launchpadlib import uris | |
from launchpadlib.launchpad import Launchpad | |
def get_abandoned_bugs(projects=None): | |
if projects is None: | |
projects = [ | |
'nova' | |
] | |
lp = Launchpad.get_token_and_login( | |
'new_bugs', | |
service_root=uris.LPNET_SERVICE_ROOT | |
) | |
print "Got credentials : %r" % lp | |
for name in projects: | |
project = lp.projects[name] | |
undecided = project.searchTasks(status=["In Progress"]) | |
for bug in iter(undecided): | |
id = int(bug.bug_link.split('/')[-1]) | |
abandoned = False | |
for message in iter(lp.bugs[id].messages): | |
if "Change abandoned" in message.content: | |
abandoned = True | |
elif "Fix proposed" in message.content: | |
abandoned = False | |
if abandoned: | |
print "Abandoned - %s : %s : %s : %s" % ( | |
bug, bug.importance, bug.status, bug.owner_link) | |
def main(): | |
get_abandoned_bugs() | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment