diff options
author | 2015-01-30 19:33:59 -0800 | |
---|---|---|
committer | 2015-01-30 20:40:29 -0800 | |
commit | 22173b6b70d6c1ba88249cf948801365cb1f64e1 (patch) | |
tree | 650d65eb584ff00306411d711545c05ba213ba68 | |
parent | gkeys: Fix verify -F logic for inline sigs (diff) | |
download | gentoo-keys-22173b6b70d6c1ba88249cf948801365cb1f64e1.tar.gz gentoo-keys-22173b6b70d6c1ba88249cf948801365cb1f64e1.tar.bz2 gentoo-keys-22173b6b70d6c1ba88249cf948801365cb1f64e1.zip |
gkeys/actions.py: separate the message info substitution
It is usually the result.username that gives the error.
This tries to trap it and keep going.
-rw-r--r-- | gkeys/gkeys/actions.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gkeys/gkeys/actions.py b/gkeys/gkeys/actions.py index dfc9f09..3852372 100644 --- a/gkeys/gkeys/actions.py +++ b/gkeys/gkeys/actions.py @@ -308,10 +308,11 @@ class Actions(object): msg = _unicode("key desired: %(name)s, key added: %(key)s, succeeded:" +\ " %(success)s, fingerprint: %(fpr)s") for result in results[key.name]: - try: - print(msg % ({'name': key.name, 'key': result.username, + umsg = msg % ({'name': key.name, 'key': result.username, 'success': str(not result.failed), - 'fpr': result.fingerprint})) + 'fpr': result.fingerprint}) + try: + print(umsg) except UnicodeDecodeError: print(_unicode("UnicodeDecodeError printing results for:"), key.name) self.logger.debug(_unicode("installkey(); UnicodeDecodeError for:") + key.name) |