mirror of
https://github.com/borgbackup/borg.git
synced 2026-06-10 17:32:13 -04:00
Merge pull request #9670 from ThomasWaldmann/borgstore05
adapt for and require borgstore 0.5.x
This commit is contained in:
commit
1a359eacb5
3 changed files with 14 additions and 14 deletions
|
|
@ -31,7 +31,7 @@ license = "BSD-3-Clause"
|
|||
license-files = ["LICENSE", "AUTHORS"]
|
||||
dependencies = [
|
||||
"borghash ~= 0.1.0",
|
||||
"borgstore ~= 0.4.0",
|
||||
"borgstore ~= 0.5.0",
|
||||
"msgpack >=1.0.3, <=1.1.2",
|
||||
"packaging",
|
||||
"platformdirs >=3.0.0, <5.0.0; sys_platform == 'darwin'", # for macOS: breaking changes in 3.0.0.
|
||||
|
|
@ -51,10 +51,10 @@ mfusepy = ["mfusepy >= 3.1.0, <4.0.0"] # fuse 2+3, high-level
|
|||
# a pypi release of borgbackup can't contain a dependency on github!
|
||||
# mfusepym = ["mfusepy @ git+https://github.com/mxmlnkn/mfusepy.git@master"]
|
||||
nofuse = []
|
||||
s3 = ["borgstore[s3] ~= 0.4.0"]
|
||||
sftp = ["borgstore[sftp] ~= 0.4.0"]
|
||||
rclone = ["borgstore[rclone] ~= 0.4.0"]
|
||||
rest = ["borgstore[rest] ~= 0.4.0"]
|
||||
s3 = ["borgstore[s3] ~= 0.5.0"]
|
||||
sftp = ["borgstore[sftp] ~= 0.5.0"]
|
||||
rclone = ["borgstore[rclone] ~= 0.5.0"]
|
||||
rest = ["borgstore[rest] ~= 0.5.0"]
|
||||
cockpit = ["textual>=6.8.0"] # might also work with older versions, untested
|
||||
|
||||
[project.urls]
|
||||
|
|
|
|||
|
|
@ -117,13 +117,13 @@ class Repository:
|
|||
self.url = url
|
||||
# lots of stuff in data: use 2 levels by default (data/00/00/ .. data/ff/ff/ dirs)!
|
||||
data_levels = int(os.environ.get("BORG_STORE_DATA_LEVELS", "2"))
|
||||
levels_config = {
|
||||
"archives/": [0],
|
||||
"cache/": [0],
|
||||
"config/": [0],
|
||||
"data/": [data_levels],
|
||||
"keys/": [0],
|
||||
"locks/": [0],
|
||||
ns_config = {
|
||||
"archives/": {"levels": [0]},
|
||||
"cache/": {"levels": [0]},
|
||||
"config/": {"levels": [0]},
|
||||
"data/": {"levels": [data_levels]},
|
||||
"keys/": {"levels": [0]},
|
||||
"locks/": {"levels": [0]},
|
||||
}
|
||||
# Get permissions from parameter or environment variable
|
||||
permissions = permissions if permissions is not None else os.environ.get("BORG_REPO_PERMISSIONS", "all")
|
||||
|
|
@ -159,7 +159,7 @@ class Repository:
|
|||
)
|
||||
|
||||
try:
|
||||
self.store = Store(url, levels=levels_config, permissions=permissions)
|
||||
self.store = Store(url, config=ns_config, permissions=permissions)
|
||||
except StoreBackendError as e:
|
||||
raise Error(str(e))
|
||||
self.store_opened = False
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ ID2 = "bar", 2, 2
|
|||
|
||||
@pytest.fixture()
|
||||
def lockstore(tmp_path):
|
||||
store = Store(Path(tmp_path / "lockstore").as_uri(), levels={"locks/": [0]})
|
||||
store = Store(Path(tmp_path / "lockstore").as_uri(), config={"locks/": {"levels": [0]}})
|
||||
store.create()
|
||||
with store:
|
||||
yield store
|
||||
|
|
|
|||
Loading…
Reference in a new issue