summaryrefslogtreecommitdiff
path: root/obnamlib/plugins/restore_plugin.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2016-07-16 09:58:18 +0300
committerLars Wirzenius <liw@liw.fi>2016-07-16 09:58:18 +0300
commitac900fd4f25b8b87c961d2add0321fac70a90b5c (patch)
tree92266e02e598f3c5f30e95db8099dcdf5d725cda /obnamlib/plugins/restore_plugin.py
parent5443b12048d1f5fbb1d618ba527530082856dafb (diff)
downloadobnam-ac900fd4f25b8b87c961d2add0321fac70a90b5c.tar.gz
Require --to for restore
Diffstat (limited to 'obnamlib/plugins/restore_plugin.py')
-rw-r--r--obnamlib/plugins/restore_plugin.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/obnamlib/plugins/restore_plugin.py b/obnamlib/plugins/restore_plugin.py
index 4b99cb69..b7944946 100644
--- a/obnamlib/plugins/restore_plugin.py
+++ b/obnamlib/plugins/restore_plugin.py
@@ -28,6 +28,11 @@ class WrongNumberOfGenerationSettingsError(obnamlib.ObnamError):
msg = 'The restore command wants exactly one generation option'
+class NoToError(obnamlib.ObnamError):
+
+ msg = 'The restore command wants a target set with --to'
+
+
class RestoreErrors(obnamlib.ObnamError):
msg = '''There were errors when restoring
@@ -124,6 +129,9 @@ class RestorePlugin(obnamlib.ObnamPlugin):
self.app.settings.require('generation')
self.app.settings.require('to')
+ if not self.app.settings['to']:
+ raise NoToError()
+
logging.debug(
'restoring generation %s', self.app.settings['generation'])
logging.debug('restoring to %s', self.app.settings['to'])