MCPcopy
hub / github.com/borgbackup/borg / get_keys_dir

Function get_keys_dir

src/borg/helpers/fs.py:77–85  ·  view source on GitHub ↗

Determine where to store repository keys.

(*, legacy=False, create=True)

Source from the content-addressed store, hash-verified

75
76
77def get_keys_dir(*, legacy=False, create=True):
78 """Determine where to store repository keys."""
79 keys_dir = os.environ.get("BORG_KEYS_DIR")
80 if keys_dir is None:
81 # note: do not just give this as default to the environment.get(), see issue #5979.
82 keys_dir = str(Path(get_config_dir(legacy=legacy)) / "keys")
83 if create:
84 ensure_dir(keys_dir)
85 return keys_dir
86
87
88def get_security_dir(repository_id=None, *, legacy=False, create=True):

Callers 4

find_keyMethod · 0.85
_find_key_in_keys_dirMethod · 0.85
to_key_filenameMethod · 0.85
test_get_keys_dirFunction · 0.85

Calls 3

get_config_dirFunction · 0.85
ensure_dirFunction · 0.85
getMethod · 0.45

Tested by 1

test_get_keys_dirFunction · 0.68