mirror of
				https://git.launchpad.net/ubuntu-dev-tools
				synced 2025-11-04 07:54:03 +00:00 
			
		
		
		
	lp-set-dup: Don't crash when accessing private bugs (lp: #525539)
This commit is contained in:
		
							parent
							
								
									3df7282fc5
								
							
						
					
					
						commit
						16addfa5ff
					
				
							
								
								
									
										3
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							@ -30,12 +30,13 @@ ubuntu-dev-tools (0.93) UNRELEASED; urgency=low
 | 
			
		||||
  * Add support for the other LP service roots (edge is still default)
 | 
			
		||||
  * Depend on python-launchpadlib >= 1.5.4
 | 
			
		||||
  * Also check package sets for upload permissions.
 | 
			
		||||
  * lp-set-dup: Don't crash when accessing private bugs (lp: #525539)
 | 
			
		||||
 | 
			
		||||
  [ Michael Vogt ]
 | 
			
		||||
  * edit-patch: add wrapper around cdbs-edit-patch, dpatch-edit-patch, quilt
 | 
			
		||||
    to transparently deal with the various patch systems.
 | 
			
		||||
 | 
			
		||||
 -- Michael Bienia <geser@ubuntu.com>  Sat, 20 Feb 2010 18:38:17 +0100
 | 
			
		||||
 -- Michael Bienia <geser@ubuntu.com>  Tue, 23 Feb 2010 00:31:19 +0100
 | 
			
		||||
 | 
			
		||||
ubuntu-dev-tools (0.92) lucid; urgency=low
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										23
									
								
								lp-set-dup
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								lp-set-dup
									
									
									
									
									
								
							@ -22,10 +22,12 @@
 | 
			
		||||
# Authors:
 | 
			
		||||
#  Loïc Minier <lool@dooz.org>
 | 
			
		||||
 | 
			
		||||
import os, sys
 | 
			
		||||
import sys
 | 
			
		||||
 | 
			
		||||
from optparse import OptionParser
 | 
			
		||||
 | 
			
		||||
import ubuntutools.lp.libsupport as lp_libsupport
 | 
			
		||||
from launchpadlib.errors import HTTPError
 | 
			
		||||
 | 
			
		||||
def die(message):
 | 
			
		||||
    print >> sys.stderr, "Fatal: " + message
 | 
			
		||||
@ -56,7 +58,14 @@ if __name__ == '__main__':
 | 
			
		||||
        die("Couldn't setup Launchpad for the ubuntu-dev-tools consumer; %s" % (suggestion, ))
 | 
			
		||||
 | 
			
		||||
    # check that the new main bug isn't a duplicate
 | 
			
		||||
    new_main_bug = launchpad.bugs[args[0]]
 | 
			
		||||
    try:
 | 
			
		||||
        new_main_bug = launchpad.bugs[args[0]]
 | 
			
		||||
    except HTTPError, error:
 | 
			
		||||
        if error.response.status == 401:
 | 
			
		||||
            print >> sys.stderr, "E: Don't have enough permissions to access bug %s" % (args[0])
 | 
			
		||||
            die(error.content)
 | 
			
		||||
        else:
 | 
			
		||||
            raise
 | 
			
		||||
    new_main_dup_of = new_main_bug.duplicate_of
 | 
			
		||||
    if new_main_dup_of is not None:
 | 
			
		||||
        s = None
 | 
			
		||||
@ -72,7 +81,15 @@ if __name__ == '__main__':
 | 
			
		||||
    bugs_to_process = []
 | 
			
		||||
    for b in args[1:]:
 | 
			
		||||
        print "Processing %s" % (b)
 | 
			
		||||
        bug = launchpad.bugs[b]
 | 
			
		||||
        try:
 | 
			
		||||
            bug = launchpad.bugs[b]
 | 
			
		||||
        except HTTPError, error:
 | 
			
		||||
            if error.response.status == 401:
 | 
			
		||||
                print >> sys.stderr, "W: Don't have enough permissions to access bug %s" % (b)
 | 
			
		||||
                print >> sys.stderr, "W: %s" % (error.content)
 | 
			
		||||
                continue
 | 
			
		||||
            else:
 | 
			
		||||
                raise
 | 
			
		||||
        dups = bug.duplicates
 | 
			
		||||
        if dups is not None:
 | 
			
		||||
            bugs_to_process.extend(dups)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user