summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2012-12-03 15:07:25 +0000
committerLars Wirzenius <liw@liw.fi>2012-12-03 15:07:25 +0000
commit0fceeb916c0efd07d22bbc9d633dcc2cabbae8be (patch)
treec3a7ba18dcfd0a8da98a28ffd384ccf778319421
parentd38d8613a619d8d668ee3b4e4e0ec14cd804bd6a (diff)
downloadobnam-0fceeb916c0efd07d22bbc9d633dcc2cabbae8be.tar.gz
Complain if no backup roots have been given
-rw-r--r--NEWS1
-rw-r--r--obnamlib/plugins/backup_plugin.py5
2 files changed, 4 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 507ba8d6..9a350558 100644
--- a/NEWS
+++ b/NEWS
@@ -50,6 +50,7 @@ Bug fixes:
by ROGERIO DE CARVALHO BASTOS and patched by Peter Valdemar Mørch.
* Setuid and setgid bits are now restored correctly, when restore happens
as root. Reported by Pavel Kokolemin.
+* Obnam now complains if no backup roots have been specfied.
Version 1.2, released 2012-10-06
--------------------------------
diff --git a/obnamlib/plugins/backup_plugin.py b/obnamlib/plugins/backup_plugin.py
index 43973fa0..686c369d 100644
--- a/obnamlib/plugins/backup_plugin.py
+++ b/obnamlib/plugins/backup_plugin.py
@@ -274,8 +274,9 @@ class BackupPlugin(obnamlib.ObnamPlugin):
self.repo.start_generation()
self.fs = None
roots = self.app.settings['root'] + args
- if roots:
- self.backup_roots(roots)
+ if not roots:
+ raise obnamlib.Error('No backup roots specified')
+ self.backup_roots(roots)
self.what('committing changes to repository')
if not self.pretend:
self.repo.lock_shared()