Commit 88f49d7a authored by Nicolas Chauvat's avatar Nicolas Chauvat
Browse files

B offer to continue even when failed to restore systemonly

--HG--
branch : stable
parent b2add17d5bc4
......@@ -169,16 +169,15 @@ class ServerMigrationHelper(MigrationHelper):
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment