mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-24 00:37:56 +00:00
Merge pull request #7078 from ThomasWaldmann/fix-item-_dict
transfer/upgrade: do not access Item._dict, fixes #7077
This commit is contained in:
commit
6e95e5464f
1 changed files with 6 additions and 6 deletions
|
@ -77,18 +77,18 @@ def upgrade_item(self, *, item):
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.hlm.borg1_hardlink_master(item):
|
if self.hlm.borg1_hardlink_master(item):
|
||||||
item._dict["hlid"] = hlid = self.hlm.hardlink_id_from_path(item._dict["path"])
|
item.hlid = hlid = self.hlm.hardlink_id_from_path(item.path)
|
||||||
self.hlm.remember(id=hlid, info=(item._dict.get("chunks"), item._dict.get("chunks_healthy")))
|
self.hlm.remember(id=hlid, info=(item.get("chunks"), item.get("chunks_healthy")))
|
||||||
elif self.hlm.borg1_hardlink_slave(item):
|
elif self.hlm.borg1_hardlink_slave(item):
|
||||||
item._dict["hlid"] = hlid = self.hlm.hardlink_id_from_path(item._dict["source"])
|
item.hlid = hlid = self.hlm.hardlink_id_from_path(item.source)
|
||||||
chunks, chunks_healthy = self.hlm.retrieve(id=hlid, default=(None, None))
|
chunks, chunks_healthy = self.hlm.retrieve(id=hlid, default=(None, None))
|
||||||
if chunks is not None:
|
if chunks is not None:
|
||||||
item._dict["chunks"] = chunks
|
item.chunks = chunks
|
||||||
for chunk_id, _ in chunks:
|
for chunk_id, _ in chunks:
|
||||||
self.cache.chunk_incref(chunk_id, self.archive.stats)
|
self.cache.chunk_incref(chunk_id, self.archive.stats)
|
||||||
if chunks_healthy is not None:
|
if chunks_healthy is not None:
|
||||||
item._dict["chunks_healthy"] = chunks
|
item.chunks_healthy = chunks
|
||||||
item._dict.pop("source") # not used for hardlinks any more, replaced by hlid
|
del item.source # not used for hardlinks any more, replaced by hlid
|
||||||
# make sure we only have desired stuff in the new item. specifically, make sure to get rid of:
|
# make sure we only have desired stuff in the new item. specifically, make sure to get rid of:
|
||||||
# - 'acl' remnants of bug in attic <= 0.13
|
# - 'acl' remnants of bug in attic <= 0.13
|
||||||
# - 'hardlink_master' (superseded by hlid)
|
# - 'hardlink_master' (superseded by hlid)
|
||||||
|
|
Loading…
Reference in a new issue