Fail gracefully when post_upload_command fail

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

Bug Description

I have an upload target defined in an old-style 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/", line 349, in invoke_dput
    logger.warning("No hooks defined in the profile. "
  File "/usr/lib/python2.7/", line 24, in __exit__
  File "/usr/lib/python2.7/dist-packages/dput/", line 175, in uploader
  File "/usr/lib/python2.7/dist-packages/dput/", line 68, in _post_hook
  File "/usr/lib/python2.7/dist-packages/dput/", line 92, in _run_hook
dput.exceptions.DputError: Command `[...]' returned an error: No distribution found for 'resteasy_3.0.1-1_amd64.changes'!
There have been errors!

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

Other bug subscribers