diff options
author | Lars Wirzenius <liw@liw.fi> | 2016-10-07 19:40:26 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2016-10-07 19:40:26 +0300 |
commit | 292e396e4b8a56c2f167b81bc4441d35a4342419 (patch) | |
tree | ff7288bbad4df3439cc0f26c825ac7bf5ed51a65 | |
parent | 7f29ce1d15b036600e225735f7618052e4f8fc06 (diff) | |
download | obnam-292e396e4b8a56c2f167b81bc4441d35a4342419.tar.gz |
Add gpg command line to error message about gpg failing
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | obnamlib/encryption.py | 8 |
2 files changed, 8 insertions, 3 deletions
@@ -49,6 +49,9 @@ Minor changes: starts, however. Also, `/proc/mounts` must be an accurate list of mount points. +* Lars Wirzenius added the gpg command line to the error message about + gpg failing. + Bug fixes: * The manual and manual page used to claim you could break only the diff --git a/obnamlib/encryption.py b/obnamlib/encryption.py index d2c78d07..45611401 100644 --- a/obnamlib/encryption.py +++ b/obnamlib/encryption.py @@ -1,4 +1,4 @@ -# Copyright 2011-2015 Lars Wirzenius +# Copyright 2011-2016 Lars Wirzenius # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -30,7 +30,8 @@ class EncryptionError(obnamlib.ObnamError): class GpgError(EncryptionError): - msg = 'gpg failed with exit code {returncode}:\n{stderr}' + msg = ('gpg failed with exit code {returncode}:\n' + 'Command: {command}\n{stderr}') def generate_symmetric_key(numbits, filename='/dev/random'): @@ -129,7 +130,8 @@ def _gpg(args, stdin='', gpghome=None): # Return output data, or deal with errors. if p.returncode: # pragma: no cover - raise GpgError(returncode=p.returncode, stderr=err) + command = ' '.join(argv) + raise GpgError(command=command, returncode=p.returncode, stderr=err) return out |