mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-13 08:01:09 +00:00
And checkUpload throws an exception instead of returning False
This commit is contained in:
parent
37e6c07dd8
commit
97a70a97cc
25
ack-sync
25
ack-sync
@ -200,13 +200,24 @@ def main(bug_numbers, all_package, all_version, all_section, update,
|
||||
src_pkg = series.getSourcePackage(name=package)
|
||||
if src_pkg is None:
|
||||
print "%s is NEW in %s." % (package, dist)
|
||||
if src_pkg is not None and not series.main_archive.checkUpload(
|
||||
component=src_pkg.latest_published_component_name,
|
||||
distroseries=series, person=launchpad.me, pocket='Release',
|
||||
sourcepackagename=package):
|
||||
print >> sys.stderr, ("E: Sorry, you are not allowed to "
|
||||
'upload package "%s" to %s.' % (package, dist))
|
||||
sys.exit(UPLOAD_NOT_PERMITTED)
|
||||
if src_pkg is not None:
|
||||
# TODO: Port ack-sync to use lpapicache and reduce code-duplication.
|
||||
can_upload = None
|
||||
try:
|
||||
series.main_archive.checkUpload(
|
||||
component=src_pkg.latest_published_component_name,
|
||||
distroseries=series, person=launchpad.me, pocket='Release',
|
||||
sourcepackagename=package)
|
||||
can_upload = True
|
||||
except lazr.restfulclient.errors.HTTPErro, e:
|
||||
if e.response.status == 403:
|
||||
can_upload = False
|
||||
else:
|
||||
raise e
|
||||
if not can_upload:
|
||||
print >> sys.stderr, ("E: Sorry, you are not allowed to "
|
||||
'upload package "%s" to %s.' % (package, dist))
|
||||
sys.exit(UPLOAD_NOT_PERMITTED)
|
||||
|
||||
if task.assignee == None:
|
||||
task.assignee = launchpad.me
|
||||
|
Loading…
x
Reference in New Issue
Block a user