MCPcopy Index your code
hub / github.com/borgbackup/borg / key_matches

Method key_matches

src/borg/cache.py:112–120  ·  view source on GitHub ↗
(self, key)

Source from the content-addressed store, hash-verified

110 return all(f.exists() for f in (self.key_type_file, self.location_file, self.manifest_ts_file))
111
112 def key_matches(self, key):
113 if not self.known():
114 return False
115 try:
116 with self.key_type_file.open() as fd:
117 type = fd.read()
118 return type == str(key.TYPE)
119 except OSError as exc:
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))

Callers 1

assert_key_typeMethod · 0.95

Calls 4

knownMethod · 0.95
warningMethod · 0.80
openMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected