(self, config_path)
| 314 | pass |
| 315 | |
| 316 | def _check_upgrade(self, config_path): |
| 317 | try: |
| 318 | cache_version = self._config.getint("cache", "version") |
| 319 | wanted_version = 1 |
| 320 | if cache_version != wanted_version: |
| 321 | self.close() |
| 322 | raise Exception( |
| 323 | "%s has unexpected cache version %d (wanted: %d)." % (config_path, cache_version, wanted_version) |
| 324 | ) |
| 325 | except configparser.NoSectionError: |
| 326 | self.close() |
| 327 | raise Exception("%s does not look like a Borg cache." % config_path) from None |
| 328 | |
| 329 | |
| 330 | class Cache: |