Fail gracefully when post_upload_command fail

Bug #1335140 reported by Benjamin Drung on 2014-06-27
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dput-ng (Ubuntu)
Undecided
Unassigned

Bug Description

I have an upload target defined in an old-style dput.cf file and there a post_upload_command specified. When this post_upload_command fails, dput-ng crashes instead of printing a nice error message:

$ dput foo resteasy_3.0.1-1_amd64.changes
Uploading resteasy using scp to foo [...]
running allowed-distribution: check whether a local profile permits uploads to the target distribution
running checksum: verify checksums before uploading
running suite-mismatch: check the target distribution for common errors
running gpg: check GnuPG signatures before the upload
Not checking GPG signature due to allow_unsigned_uploads being set.
SCP is deprecated. Please consider upgrading to SFTP.
Uploading libresteasy-java_3.0.1-1_all.deb
Uploading resteasy_3.0.1-1_amd64.changes
Traceback (most recent call last):
  File "/usr/bin/dput", line 106, in <module>
    upload_package(changes, args)
  File "/usr/lib/python2.7/dist-packages/dput/uploader.py", line 349, in invoke_dput
    logger.warning("No hooks defined in the profile. "
  File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
    self.gen.next()
  File "/usr/lib/python2.7/dist-packages/dput/uploader.py", line 175, in uploader
    obj._post_hook()
  File "/usr/lib/python2.7/dist-packages/dput/uploader.py", line 68, in _post_hook
    self._run_hook("post_upload_command")
  File "/usr/lib/python2.7/dist-packages/dput/uploader.py", line 92, in _run_hook
    ret
dput.exceptions.DputError: Command `[...]' returned an error: No distribution found for 'resteasy_3.0.1-1_amd64.changes'!
There have been errors!
 [err=243]

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers