diff options
author | Lars Wirzenius <liw@liw.fi> | 2013-08-15 18:39:42 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2013-08-15 18:39:42 +0100 |
commit | 3bfb2124dd3c1be25074caa37fc7dc02e91c4516 (patch) | |
tree | 43cccb7652ca14eadefd97cb3594963031d33f5c | |
parent | 591d01ba585ef1de989ba0b1aa66383ad5e3202f (diff) | |
download | obnam-3bfb2124dd3c1be25074caa37fc7dc02e91c4516.tar.gz |
Fix encryption plugin error message when finding client dirs
Fix by Lars Kruse
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | obnamlib/plugins/encryption_plugin.py | 10 |
2 files changed, 12 insertions, 2 deletions
@@ -15,6 +15,10 @@ Bug fixes: unable to read the per-client directory of another client, when encryption is used. Fix by Lars Kruse. +* Fix the encryption plugin to give a better error message when it + looks for client directories but fails to find them. Fix by + Lars Kruse. + Version 1.5, released 2013-08-08 -------------------------------- diff --git a/obnamlib/plugins/encryption_plugin.py b/obnamlib/plugins/encryption_plugin.py index d8173346..bbca00c5 100644 --- a/obnamlib/plugins/encryption_plugin.py +++ b/obnamlib/plugins/encryption_plugin.py @@ -232,8 +232,14 @@ class EncryptionPlugin(obnamlib.ObnamPlugin): _shared = ['chunklist', 'chunks', 'chunksums', 'clientlist'] def _find_clientdirs(self, repo, client_names): - return [repo.client_dir(repo.clientlist.get_client_id(x)) - for x in client_names] + result = [] + for client_name in client_names: + client_id = repo.clientlist.get_client_id(client_name) + if client_id: + result.append(repo.client_dir(client_id)) + else: + logging.warning("client not found: %s" % client_name) + return result def add_key(self, args): '''Add a key to the repository.''' |