cubicweb/server/migractions.py
changeset 11982 8d1525c76e65
parent 11981 56e99b59272f
child 11999 f69288934d66
equal deleted inserted replaced
11981:56e99b59272f 11982:8d1525c76e65
   274             source.restore(osp.join(tmpdir, source.uri), self.confirm, drop, format)
   274             source.restore(osp.join(tmpdir, source.uri), self.confirm, drop, format)
   275         except Exception as exc:
   275         except Exception as exc:
   276             print('-> error trying to restore %s [%s]' % (source.uri, exc))
   276             print('-> error trying to restore %s [%s]' % (source.uri, exc))
   277             if not self.confirm('Continue anyway?', default='n'):
   277             if not self.confirm('Continue anyway?', default='n'):
   278                 raise SystemExit(1)
   278                 raise SystemExit(1)
   279         shutil.rmtree(tmpdir)
   279         finally:
       
   280             shutil.rmtree(tmpdir)
   280         # call hooks
   281         # call hooks
   281         repo.bootstrap()
   282         repo.bootstrap()
   282         repo.hm.call_hooks('server_restore', repo=repo, timestamp=backupfile)
   283         repo.hm.call_hooks('server_restore', repo=repo, timestamp=backupfile)
   283         print('-> database restored.')
   284         print('-> database restored.')
   284 
   285