summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-04-12 14:04:36 +0100
committerLars Wirzenius <liw@liw.fi>2011-04-12 14:04:36 +0100
commit0bea46faad3b9234148e654c56193fbf6d827ce3 (patch)
tree1a9b7787c1b154462a722f6964ba12ac1102e343
parent19219bc936e210786a9cfb7b0a0536d798c56cb1 (diff)
downloadobnam-0bea46faad3b9234148e654c56193fbf6d827ce3.tar.gz
Fix Clientlist.list_clients to list only client names.
-rw-r--r--obnamlib/clientlist.py4
-rw-r--r--obnamlib/clientlist_tests.py1
2 files changed, 4 insertions, 1 deletions
diff --git a/obnamlib/clientlist.py b/obnamlib/clientlist.py
index 577889dc..99b6cfe6 100644
--- a/obnamlib/clientlist.py
+++ b/obnamlib/clientlist.py
@@ -72,7 +72,9 @@ class ClientList(obnamlib.RepositoryTree):
def list_clients(self):
if self.init_forest() and self.forest.trees:
t = self.forest.trees[-1]
- return [v for k, v in t.lookup_range(self.minkey, self.maxkey)]
+ return [v
+ for k, v in t.lookup_range(self.minkey, self.maxkey)
+ if self.unkey(k)[2] == self.CLIENT_NAME]
else:
return []
diff --git a/obnamlib/clientlist_tests.py b/obnamlib/clientlist_tests.py
index a98bb088..b65e98ae 100644
--- a/obnamlib/clientlist_tests.py
+++ b/obnamlib/clientlist_tests.py
@@ -58,6 +58,7 @@ class ClientListTests(unittest.TestCase):
def test_added_client_is_listed(self):
self.list.add_client('foo')
+ self.list.set_client_keyid('foo', 'cafebeef')
self.assertEqual(self.list.list_clients(), ['foo'])
def test_removed_client_has_none_id(self):