mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-16 01:21:07 +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)
|
src_pkg = series.getSourcePackage(name=package)
|
||||||
if src_pkg is None:
|
if src_pkg is None:
|
||||||
print "%s is NEW in %s." % (package, dist)
|
print "%s is NEW in %s." % (package, dist)
|
||||||
if src_pkg is not None and not series.main_archive.checkUpload(
|
if src_pkg is not None:
|
||||||
component=src_pkg.latest_published_component_name,
|
# TODO: Port ack-sync to use lpapicache and reduce code-duplication.
|
||||||
distroseries=series, person=launchpad.me, pocket='Release',
|
can_upload = None
|
||||||
sourcepackagename=package):
|
try:
|
||||||
print >> sys.stderr, ("E: Sorry, you are not allowed to "
|
series.main_archive.checkUpload(
|
||||||
'upload package "%s" to %s.' % (package, dist))
|
component=src_pkg.latest_published_component_name,
|
||||||
sys.exit(UPLOAD_NOT_PERMITTED)
|
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:
|
if task.assignee == None:
|
||||||
task.assignee = launchpad.me
|
task.assignee = launchpad.me
|
||||||
|
Loading…
x
Reference in New Issue
Block a user