# HG changeset patch # User Nicolas Chauvat # Date 1250281305 -7200 # Node ID 9cb3027407aaf31b08641bb9a920517c41878642 # Parent b2add17d5bc437a807976cd13870f92d3a94f2a6 B offer to continue even when failed to restore systemonly diff -r b2add17d5bc4 -r 9cb3027407aa server/migractions.py --- a/server/migractions.py Fri Aug 14 19:04:15 2009 +0200 +++ b/server/migractions.py Fri Aug 14 22:21:45 2009 +0200 @@ -169,16 +169,15 @@ bkup = tarfile.open(backupfile, 'r|gz') tmpdir = tempfile.mkdtemp() bkup.extractall(path=tmpdir) - if systemonly: - repo.system_source.restore(osp.join(tmpdir,'system'), drop=drop) - else: - for source in repo.sources: - try: - source.restore(osp.join(tmpdir, source.uri), drop=drop) - except Exception, exc: - print '-> error trying to restore [%s]' % exc - if not self.confirm('Continue anyway?', default='n'): - raise SystemExit(1) + for source in repo.sources: + if systemonly and source.uri != 'system': + continue + try: + source.restore(osp.join(tmpdir, source.uri), drop=drop) + except Exception, exc: + print '-> error trying to restore [%s]' % exc + if not self.confirm('Continue anyway?', default='n'): + raise SystemExit(1) bkup.close() shutil.rmtree(tmpdir) # call hooks