server/sources/native.py
changeset 11115 a385bd146178
parent 11060 3699fca78836
child 11118 0c645f09d96a
equal deleted inserted replaced
11114:468b91aabd9d 11115:a385bd146178
  1709         sequences = archive.read('sequences.txt').splitlines()
  1709         sequences = archive.read('sequences.txt').splitlines()
  1710         numranges = archive.read('numranges.txt').splitlines()
  1710         numranges = archive.read('numranges.txt').splitlines()
  1711         archive_versions = self._parse_versions(archive.read('versions.txt'))
  1711         archive_versions = self._parse_versions(archive.read('versions.txt'))
  1712         db_versions = set(self._get_versions())
  1712         db_versions = set(self._get_versions())
  1713         if archive_versions != db_versions:
  1713         if archive_versions != db_versions:
  1714             self.logger.critical('Restore warning : versions do not match')
  1714             self.logger.critical('Restore warning: versions do not match')
  1715             new_cubes = db_versions - archive_versions
  1715             new_cubes = db_versions - archive_versions
  1716             if new_cubes:
  1716             if new_cubes:
  1717                 self.logger.critical('In the db:\n%s', '\n'.join('%s : %s' % (cube, ver)
  1717                 self.logger.critical('In the db:\n%s', '\n'.join('%s: %s' % (cube, ver)
  1718                                                             for cube, ver in sorted(new_cubes)))
  1718                                                             for cube, ver in sorted(new_cubes)))
  1719             old_cubes = archive_versions - db_versions
  1719             old_cubes = archive_versions - db_versions
  1720             if old_cubes:
  1720             if old_cubes:
  1721                 self.logger.critical('In the archive:\n%s', '\n'.join('%s : %s' % (cube, ver)
  1721                 self.logger.critical('In the archive:\n%s', '\n'.join('%s: %s' % (cube, ver)
  1722                                                             for cube, ver in sorted(old_cubes)))
  1722                                                             for cube, ver in sorted(old_cubes)))
  1723             if not ASK.confirm('Versions mismatch: continue anyway ?', False):
  1723             if not ASK.confirm('Versions mismatch: continue anyway ?', False):
  1724                 raise ValueError('Unable to restore : versions do not match')
  1724                 raise ValueError('Unable to restore: versions do not match')
  1725         table_chunks = {}
  1725         table_chunks = {}
  1726         for name in archive.namelist():
  1726         for name in archive.namelist():
  1727             if not name.startswith('tables/'):
  1727             if not name.startswith('tables/'):
  1728                 continue
  1728                 continue
  1729             filename = basename(name)
  1729             filename = basename(name)