From 4b8839ef15d727fd6021b560bcf935079dbee78a Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Sat, 9 May 2009 21:08:46 +0100 Subject: [PATCH] - Correct bug supervisor team to ubuntu-bugcontrol - Remove team names from sponsorship message - makes the function much simpler Also check if teams are valid using is_valid. --- debian/changelog | 5 ++++- requestsync | 32 +++++++++++--------------------- ubuntutools/lp/functions.py | 2 +- 3 files changed, 16 insertions(+), 23 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7635cc0..0ca9b47 100644 --- a/debian/changelog +++ b/debian/changelog @@ -23,11 +23,14 @@ ubuntu-dev-tools (0.74) UNRELEASED; urgency=low instead of checking team membership - Default to current development release if no release is specified on commandline + - Correct bug supervisor team to ubuntu-bugcontrol + - Remove team names from sponsorship message - makes the function much + simpler * buildd - Check if user has upload privileges instead of checking for team membership when seeing if operations are permitted - -- Iain Lane Sat, 09 May 2009 20:09:28 +0100 + -- Iain Lane Sat, 09 May 2009 21:06:52 +0100 ubuntu-dev-tools (0.73) karmic; urgency=low diff --git a/requestsync b/requestsync index 7e02d1b..c25bf1c 100755 --- a/requestsync +++ b/requestsync @@ -60,25 +60,14 @@ def checkNeedsSponsorship(srcpkg): The prepareLaunchpadCookie function above shall ensure that a cookie file exists first. """ - if component in ['main', 'restricted']: - team = "ubuntu-core-dev" - sponsor = "ubuntu-main-sponsors" - else: - team = "motu" - sponsor = "ubuntu-universe-sponsors" - if not lp_functions.canUploadPackage(srcpkg): - # Check if they have a per-package upload permission. - if lp_functions.isPerPackageUploader(args[0]): - return "perpackageupload" - - print "You are not a member (direct or indirect) of the '%s' " \ - "team on Launchpad." % team - print "Your sync request shall require an approval by a member of " \ - "the '%s'\nteam, who shall be subscribed to this bug report." % sponsor - print "This must be done before it can be processed by a member of " \ - "the Ubuntu Archive team." + print "You are not able to upload this package directly to Ubuntu.\n" \ + "Your sync request shall require an approval by a member of " \ + "the appropriate sponsorship team, who shall be subscribed to " \ + "this bug report.\n" \ + "This must be done before it can be processed by a member of " \ + "the Ubuntu Archive team." print "If the above is correct please press Enter." raw_input_exit_on_ctrlc() # Abort if necessary. return True # Sponsorship required. @@ -384,8 +373,8 @@ def post_bug(source_package, subscribe, status, bugtitle, bugtext): #newly created bugreports have one task task = bug.bug_tasks[0] - # Only members of ubuntu-bugs can set importance - if lp_functions.isLPTeamMember('ubuntu-bugs'): + # Only members of ubuntu-bugcontrol can set importance + if lp_functions.isLPTeamMember('ubuntu-bugcontrol'): task.transitionToImportance(importance='Wishlist') task.transitionToStatus(status=status) @@ -572,8 +561,9 @@ if __name__ == '__main__': '>>> ENTER_EXPLANATION_HERE <<<\n\n' - if sponsorship == 'perpackageupload': - report += 'Note that I have per-package upload permissions for %s.\n\n' % srcpkg + # Check if they have a per-package upload permission. + if lp_functions.isPerPackageUploader(srcpkg): + report += 'Note that I have per-package upload permissions for %s.\n\n' % srcpkg uidx = base_ver.find('build') if uidx > 0: diff --git a/ubuntutools/lp/functions.py b/ubuntutools/lp/functions.py index 7b79a47..3c2f7d2 100644 --- a/ubuntutools/lp/functions.py +++ b/ubuntutools/lp/functions.py @@ -128,7 +128,7 @@ def _findMember(haystack, needle): if not haystack.is_team: return (str(haystack) == str(needle)) - else: # is a team + elif haystack.is_valid: # is a team members = haystack.members for m in members: if _findMember(m, needle):