server/migractions.py
changeset 9457 d5ed6efd6448
parent 9456 a79e88aad555
child 9460 a2a0bc984863
equal deleted inserted replaced
9456:a79e88aad555 9457:d5ed6efd6448
   215                 # done
   215                 # done
   216                 print '-> backup file',  backupfile
   216                 print '-> backup file',  backupfile
   217         finally:
   217         finally:
   218             shutil.rmtree(tmpdir)
   218             shutil.rmtree(tmpdir)
   219 
   219 
   220     def restore_database(self, backupfile, drop=True, systemonly=True,
   220     def restore_database(self, backupfile, drop=True, askconfirm=True, format='native'):
   221                          askconfirm=True, format='native'):
       
   222         # check
   221         # check
   223         if not osp.exists(backupfile):
   222         if not osp.exists(backupfile):
   224             raise ExecutionError("Backup file %s doesn't exist" % backupfile)
   223             raise ExecutionError("Backup file %s doesn't exist" % backupfile)
   225         if askconfirm and not self.confirm('Restore %s database from %s ?'
   224         if askconfirm and not self.confirm('Restore %s database from %s ?'
   226                                            % (self.config.appid, backupfile)):
   225                                            % (self.config.appid, backupfile)):