mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-16 01:21:07 +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.
|
- Use optparse instead of getopt for option parsing.
|
||||||
- Skip existing bug report check if python-launchpad-bugs is not
|
- Skip existing bug report check if python-launchpad-bugs is not
|
||||||
installed.
|
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
|
-- 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
|
import urllib2
|
||||||
from debian_bundle.changelog import Version
|
from debian_bundle.changelog import Version
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
from time import sleep
|
||||||
|
|
||||||
# Use functions from ubuntu-dev-tools to create Launchpad cookie file.
|
# Use functions from ubuntu-dev-tools to create Launchpad cookie file.
|
||||||
sys.path.append('/usr/share/ubuntu-dev-tools/')
|
sys.path.append('/usr/share/ubuntu-dev-tools/')
|
||||||
@ -339,12 +340,11 @@ def post_bug(source_package, subscribe, status, bugtitle, bugtext):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
import launchpadbugs.connector
|
import launchpadbugs.connector
|
||||||
|
from launchpadbugs.lpconstants import HTTPCONNECTION
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print >> sys.stderr, 'Importing launchpadbugs failed. Is python-launchpad-bugs installed?'
|
print >> sys.stderr, 'Importing launchpadbugs failed. Is python-launchpad-bugs installed?'
|
||||||
return False
|
return False
|
||||||
|
|
||||||
print "Using cookie file at", launchpad_cookiefile
|
|
||||||
|
|
||||||
if source_package:
|
if source_package:
|
||||||
product = {'name': source_package, 'target': 'ubuntu'}
|
product = {'name': source_package, 'target': 'ubuntu'}
|
||||||
else:
|
else:
|
||||||
@ -366,20 +366,32 @@ def post_bug(source_package, subscribe, status, bugtitle, bugtext):
|
|||||||
in_confirm_loop = False
|
in_confirm_loop = False
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
print "Invalid answer"
|
print "Invalid answer."
|
||||||
|
|
||||||
# Create bug
|
# Create bug
|
||||||
Bug = launchpadbugs.connector.ConnectBug()
|
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)
|
bug = Bug.New(product = product, summary = bugtitle, description = bugtext)
|
||||||
|
sleep(2) # Wait in case of slow Launchpad.
|
||||||
|
|
||||||
try:
|
try:
|
||||||
bug.importance = 'Wishlist'
|
bug.importance = 'Wishlist'
|
||||||
except IOError, s:
|
except IOError, s:
|
||||||
print "Warning: setting importance failed: %s" % s
|
print "Warning: setting importance failed: %s" % s
|
||||||
|
|
||||||
bug.status = status
|
bug.status = status
|
||||||
bug.subscriptions.add(subscribe)
|
bug.subscriptions.add(subscribe)
|
||||||
|
sleep(1) # Wait.
|
||||||
|
|
||||||
bug.commit()
|
bug.commit()
|
||||||
|
sleep(1) # Wait.
|
||||||
|
|
||||||
print 'Sync request filed as bug #%i: https://launchpad.net/bugs/%i' % (bug.bugnumber, bug.bugnumber)
|
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