diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-04-12 15:03:02 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-04-12 15:03:02 +0100 |
commit | 3f4383ce5a1e5876c4744f05ae8ee81d0197dc70 (patch) | |
tree | 4ae3cbbcaa8cb5f5ef62e1ae89d1bba283d433b4 | |
parent | 71608e93e2cf7ee39bf0e1e372a4f9a9ffb5e8f6 (diff) | |
download | obnam-3f4383ce5a1e5876c4744f05ae8ee81d0197dc70.tar.gz |
Add remove-client subcommand.
Arguably this should be somewhere else than the
encryption plugin. Maybe later.
-rw-r--r-- | obnamlib/plugins/encryption_plugin.py | 9 | ||||
-rwxr-xr-x | test-encrypted-repo | 4 |
2 files changed, 13 insertions, 0 deletions
diff --git a/obnamlib/plugins/encryption_plugin.py b/obnamlib/plugins/encryption_plugin.py index aa0d0f1c..240aad70 100644 --- a/obnamlib/plugins/encryption_plugin.py +++ b/obnamlib/plugins/encryption_plugin.py @@ -48,6 +48,7 @@ class EncryptionPlugin(obnamlib.ObnamPlugin): self.app.register_command('list-toplevels', self.list_toplevels) self.app.register_command('add-key', self.add_key) self.app.register_command('remove-key', self.remove_key) + self.app.register_command('remove-client', self.remove_client) @property def keyid(self): @@ -180,3 +181,11 @@ class EncryptionPlugin(obnamlib.ObnamPlugin): for toplevel in self._shared + clients: self.remove_from_userkeys(repo, toplevel, keyid) + def remove_client(self, args): + repo = self.app.open_repository() + repo.lock_root() + for client_name in args: + logging.info('removing client %s' % client_name) + repo.remove_client(client_name) + repo.commit_root() + diff --git a/test-encrypted-repo b/test-encrypted-repo index d3cf379e..4dc1ad82 100755 --- a/test-encrypted-repo +++ b/test-encrypted-repo @@ -36,3 +36,7 @@ echo "remove key" $cmd remove-key --keyid $key2 yeehaa $cmd list-keys +echo "remove client" +$cmd remove-client yeehaa +$cmd client-keys + |