(self, manifest, key)
| 120 | logger.warning("Could not read/parse key type file: %s", exc) |
| 121 | |
| 122 | def save(self, manifest, key): |
| 123 | logger.debug("security: saving state for %s to %s", self.repository.id_str, str(self.dir)) |
| 124 | current_location = self.repository._location.canonical_path() |
| 125 | logger.debug("security: current location %s", current_location) |
| 126 | logger.debug("security: key type %s", str(key.TYPE)) |
| 127 | logger.debug("security: manifest timestamp %s", manifest.timestamp) |
| 128 | with SaveFile(self.location_file) as fd: |
| 129 | fd.write(current_location) |
| 130 | with SaveFile(self.key_type_file) as fd: |
| 131 | fd.write(str(key.TYPE)) |
| 132 | with SaveFile(self.manifest_ts_file) as fd: |
| 133 | fd.write(manifest.timestamp) |
| 134 | |
| 135 | def assert_location_matches(self): |
| 136 | # Warn user before sending data to a relocated repository |
no test coverage detected