mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-04-16 12:51:08 +00:00
Use the improved staging support in lpapicache
This commit is contained in:
parent
13cbe49a19
commit
a435c3234b
@ -91,10 +91,6 @@ if __name__ == '__main__':
|
||||
|
||||
# import the needed requestsync module
|
||||
if options.lpapi:
|
||||
# Needs to be set before lpapicache is imported:
|
||||
import ubuntutools.lp
|
||||
ubuntutools.lp.service = options.lpinstance
|
||||
|
||||
from ubuntutools.requestsync.lp import (checkExistingReports,
|
||||
getDebianSrcPkg,
|
||||
getUbuntuSrcPkg,
|
||||
@ -103,7 +99,7 @@ if __name__ == '__main__':
|
||||
# See if we have LP credentials and exit if we don't - cannot continue in this case
|
||||
|
||||
try:
|
||||
Launchpad.login()
|
||||
Launchpad.login(service=options.lpinstance)
|
||||
except IOError:
|
||||
sys.exit(1)
|
||||
else:
|
||||
|
@ -52,11 +52,12 @@ __all__ = [
|
||||
class Launchpad(object):
|
||||
'''Singleton for LP API access.'''
|
||||
|
||||
def login(self):
|
||||
def login(self, service=service):
|
||||
'''Enforce a non-anonymous login.'''
|
||||
if '_Launchpad__lp' not in self.__dict__:
|
||||
try:
|
||||
self.__lp = libsupport.get_launchpad('ubuntu-dev-tools')
|
||||
self.__lp = libsupport.get_launchpad('ubuntu-dev-tools',
|
||||
server=service)
|
||||
except IOError, error:
|
||||
print >> sys.stderr, 'E: %s' % error
|
||||
raise
|
||||
|
Loading…
x
Reference in New Issue
Block a user