diff options
author | Lars Wirzenius <liw@liw.fi> | 2012-05-24 17:06:11 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2012-05-24 17:06:11 +0200 |
commit | b55ef9c5c3e09e0426af9805bd8a718907c15f55 (patch) | |
tree | 325dfa73c474472e432a48302647cb3a9a1b539a | |
parent | b23734df7124fe97f3d444f8033cb0abedaa97f5 (diff) | |
download | obnam-b55ef9c5c3e09e0426af9805bd8a718907c15f55.tar.gz |
Fix error message when root is not a directory
Thanks to Edward Allcutt for the report.
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | debian/changelog | 7 | ||||
-rw-r--r-- | obnamlib/plugins/backup_plugin.py | 20 |
3 files changed, 25 insertions, 5 deletions
@@ -18,6 +18,9 @@ Version 0.29, released UNRELEASED; a BETA release * "obnam fsck" is now a bit faster. * The shared directories in the repository are now locked only during updates, allowing more efficient concurrent backups between several computers. +* Obnam now gives a better error message when a backup root is not a + directory. Thanks to Edward Allcutt for reporting the error + (<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=654211>). Version 0.28, released 2012-05-10; a BETA release ------------------------------------------------- diff --git a/debian/changelog b/debian/changelog index f1a1f2eb..2c2fe155 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +obnam (0.29-1) unstable; urgency=low + + * New upstream release. + - Fix "backup of individual file fails with ENOENT" (Closes: #654211) + + -- Lars Wirzenius <liw@liw.fi> Thu, 24 May 2012 17:05:25 +0200 + obnam (0.28-1) unstable; urgency=low * New upstream version. Closes the following bugs reported to Debian: diff --git a/obnamlib/plugins/backup_plugin.py b/obnamlib/plugins/backup_plugin.py index ad321dc3..830edb96 100644 --- a/obnamlib/plugins/backup_plugin.py +++ b/obnamlib/plugins/backup_plugin.py @@ -226,17 +226,27 @@ class BackupPlugin(obnamlib.ObnamPlugin): logging.info('Backup finished.') self.app.dump_memory_profile('at end of backup run') - except BaseException: + except BaseException, e: + logging.debug('Handling exception %s' % str(e)) + logging.debug(traceback.format_exc()) + self.unlock_when_error() + raise + + if self.errors: + raise obnamlib.Error('There were errors during the backup') + + def unlock_when_error(self): + try: if self.repo.got_client_lock: logging.info('Unlocking client because of error') self.repo.unlock_client() if self.repo.got_shared_lock: logging.info('Unlocking shared trees because of error') self.repo.unlock_shared() - raise - - if self.errors: - raise obnamlib.Error('There were errors during the backup') + except BaseException, e2: + logging.debug('Got second exception while unlocking: %s' % + str(e2)) + logging.debug(traceback.format_exc()) def add_chunks_to_shared(self): if self.chunkid_pool: |