# HG changeset patch # User Denis Laxalde # Date 1487868671 -3600 # Node ID 8d1525c76e65ef29394fde5f0cadb9c149b1f5f1 # Parent 56e99b59272fd055d4f1383b6d085f424bab1b15 [server] Also remove tmpdir in case of error during restore database command diff -r 56e99b59272f -r 8d1525c76e65 cubicweb/server/migractions.py --- a/cubicweb/server/migractions.py Thu Feb 23 17:47:18 2017 +0100 +++ b/cubicweb/server/migractions.py Thu Feb 23 17:51:11 2017 +0100 @@ -276,7 +276,8 @@ print('-> error trying to restore %s [%s]' % (source.uri, exc)) if not self.confirm('Continue anyway?', default='n'): raise SystemExit(1) - shutil.rmtree(tmpdir) + finally: + shutil.rmtree(tmpdir) # call hooks repo.bootstrap() repo.hm.call_hooks('server_restore', repo=repo, timestamp=backupfile)