mirror of
				https://git.launchpad.net/ubuntu-dev-tools
				synced 2025-11-04 07:54:03 +00:00 
			
		
		
		
	* requestsync: Implemented sleeps to --lp bug reporting in case of a slow
Launchpad to stop mass bug filing (LP: #311289).
This commit is contained in:
		
							parent
							
								
									ff3c4a269f
								
							
						
					
					
						commit
						eee4c697d5
					
				
							
								
								
									
										2
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							@ -8,6 +8,8 @@ ubuntu-dev-tools (0.51) UNRELEASED; urgency=low
 | 
			
		||||
    - Use optparse instead of getopt for option parsing.
 | 
			
		||||
    - Skip existing bug report check if python-launchpad-bugs is not
 | 
			
		||||
      installed.
 | 
			
		||||
    - Implemented sleeps to --lp bug reporting in case of a slow
 | 
			
		||||
      Launchpad to stop mass bug filing (LP: #311289).
 | 
			
		||||
 | 
			
		||||
 -- Jonathan Davies <jpds@ubuntu.com>  Tue, 30 Dec 2008 15:51:55 +0000
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										20
									
								
								requestsync
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								requestsync
									
									
									
									
									
								
							@ -32,6 +32,7 @@ import urllib
 | 
			
		||||
import urllib2
 | 
			
		||||
from debian_bundle.changelog import Version
 | 
			
		||||
from optparse import OptionParser
 | 
			
		||||
from time import sleep
 | 
			
		||||
 | 
			
		||||
# Use functions from ubuntu-dev-tools to create Launchpad cookie file.
 | 
			
		||||
sys.path.append('/usr/share/ubuntu-dev-tools/')
 | 
			
		||||
@ -339,12 +340,11 @@ def post_bug(source_package, subscribe, status, bugtitle, bugtext):
 | 
			
		||||
 | 
			
		||||
    try:
 | 
			
		||||
        import launchpadbugs.connector
 | 
			
		||||
        from launchpadbugs.lpconstants import HTTPCONNECTION
 | 
			
		||||
    except ImportError:
 | 
			
		||||
        print >> sys.stderr, 'Importing launchpadbugs failed. Is python-launchpad-bugs installed?'
 | 
			
		||||
        return False
 | 
			
		||||
 | 
			
		||||
    print "Using cookie file at", launchpad_cookiefile
 | 
			
		||||
 | 
			
		||||
    if source_package:
 | 
			
		||||
        product = {'name': source_package, 'target': 'ubuntu'}
 | 
			
		||||
    else:
 | 
			
		||||
@ -366,20 +366,32 @@ def post_bug(source_package, subscribe, status, bugtitle, bugtext):
 | 
			
		||||
                in_confirm_loop = False
 | 
			
		||||
                break
 | 
			
		||||
            else:
 | 
			
		||||
                print "Invalid answer"
 | 
			
		||||
                print "Invalid answer."
 | 
			
		||||
 | 
			
		||||
    # Create bug
 | 
			
		||||
    Bug = launchpadbugs.connector.ConnectBug()
 | 
			
		||||
    Bug.authentication = launchpad_cookiefile
 | 
			
		||||
    # Force the usage of stable Launchpad.
 | 
			
		||||
    Bug.set_connection_mode(HTTPCONNECTION.MODE.STABLE)
 | 
			
		||||
 | 
			
		||||
    # Use our cookie file for authentication.
 | 
			
		||||
    Bug.authentication = launchpad_cookiefile
 | 
			
		||||
    print "Using LP cookie at: %s for authentication." % launchpad_cookiefile 
 | 
			
		||||
 | 
			
		||||
    # Submit bug report.
 | 
			
		||||
    bug = Bug.New(product = product, summary = bugtitle, description = bugtext)
 | 
			
		||||
    sleep(2) # Wait in case of slow Launchpad.
 | 
			
		||||
 | 
			
		||||
    try:
 | 
			
		||||
        bug.importance = 'Wishlist'
 | 
			
		||||
    except IOError, s:
 | 
			
		||||
        print "Warning: setting importance failed: %s" % s
 | 
			
		||||
    
 | 
			
		||||
    bug.status = status
 | 
			
		||||
    bug.subscriptions.add(subscribe)
 | 
			
		||||
    sleep(1) # Wait.
 | 
			
		||||
 | 
			
		||||
    bug.commit()
 | 
			
		||||
    sleep(1) # Wait.
 | 
			
		||||
 | 
			
		||||
    print 'Sync request filed as bug #%i: https://launchpad.net/bugs/%i' % (bug.bugnumber, bug.bugnumber)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user