diff options
author | Lars Wirzenius <liw@liw.fi> | 2013-10-13 14:30:28 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2013-10-13 14:30:28 +0100 |
commit | b9f89930a95bff65d66ed18981042fdc8f41ecc4 (patch) | |
tree | 33b28670c61014e4d84c583dde8ae46aa81c28a3 /obnamlib/plugins/show_plugin.py | |
parent | 91ee040b10b2bc3a9df790841a99d70397bf0548 (diff) | |
download | obnam-b9f89930a95bff65d66ed18981042fdc8f41ecc4.tar.gz |
Avoid "obnam clients" requiring an existing client
Patch by Itamar Turner-Trauring.
Diffstat (limited to 'obnamlib/plugins/show_plugin.py')
-rw-r--r-- | obnamlib/plugins/show_plugin.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/obnamlib/plugins/show_plugin.py b/obnamlib/plugins/show_plugin.py index 8e9bffb1..1b94ffc5 100644 --- a/obnamlib/plugins/show_plugin.py +++ b/obnamlib/plugins/show_plugin.py @@ -64,15 +64,17 @@ class ShowPlugin(obnamlib.ObnamPlugin): metavar='AGE', default=obnamlib.DEFAULT_NAGIOS_WARN_AGE) - def open_repository(self): + def open_repository(self, require_client=True): self.app.settings.require('repository') - self.app.settings.require('client-name') + if require_client: + self.app.settings.require('client-name') self.repo = self.app.open_repository() - self.repo.open_client(self.app.settings['client-name']) + if require_client: + self.repo.open_client(self.app.settings['client-name']) def clients(self, args): '''List clients using the repository.''' - self.open_repository() + self.open_repository(require_client=False) for client_name in self.repo.list_clients(): self.app.output.write('%s\n' % client_name) self.repo.fs.close() |