mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-25 17:27:31 +00:00
remove ARCHIVE_KEYS duplication
also: get key set in sync, obviously we have "recreate_partial_chunks" in ArchiveItem still.
This commit is contained in:
parent
1a2691c6e4
commit
fc30a0765b
2 changed files with 3 additions and 6 deletions
|
@ -10,7 +10,7 @@
|
||||||
# this set must be kept complete, otherwise rebuild_manifest might malfunction:
|
# this set must be kept complete, otherwise rebuild_manifest might malfunction:
|
||||||
ARCHIVE_KEYS = frozenset(['version', 'name', 'items', 'cmdline', 'hostname', 'username', 'time', 'time_end',
|
ARCHIVE_KEYS = frozenset(['version', 'name', 'items', 'cmdline', 'hostname', 'username', 'time', 'time_end',
|
||||||
'comment', 'chunker_params',
|
'comment', 'chunker_params',
|
||||||
'recreate_cmdline', 'recreate_source_id', 'recreate_args'])
|
'recreate_cmdline', 'recreate_source_id', 'recreate_args', 'recreate_partial_chunks',])
|
||||||
|
|
||||||
# this is the set of keys that are always present in archives:
|
# this is the set of keys that are always present in archives:
|
||||||
REQUIRED_ARCHIVE_KEYS = frozenset(['version', 'name', 'items', 'cmdline', 'time', ])
|
REQUIRED_ARCHIVE_KEYS = frozenset(['version', 'name', 'items', 'cmdline', 'time', ])
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import stat
|
import stat
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
from .constants import ITEM_KEYS
|
from .constants import ITEM_KEYS, ARCHIVE_KEYS
|
||||||
from .helpers import safe_encode, safe_decode
|
from .helpers import safe_encode, safe_decode
|
||||||
from .helpers import bigint_to_int, int_to_bigint
|
from .helpers import bigint_to_int, int_to_bigint
|
||||||
from .helpers import StableDict
|
from .helpers import StableDict
|
||||||
|
@ -349,10 +349,7 @@ class ArchiveItem(PropDict):
|
||||||
If a ArchiveItem shall be serialized, give as_dict() method output to msgpack packer.
|
If a ArchiveItem shall be serialized, give as_dict() method output to msgpack packer.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
VALID_KEYS = {'version', 'name', 'items', 'cmdline', 'hostname', 'username', 'time', 'time_end',
|
VALID_KEYS = ARCHIVE_KEYS # str-typed keys
|
||||||
'comment', 'chunker_params',
|
|
||||||
'recreate_cmdline', 'recreate_source_id', 'recreate_args', 'recreate_partial_chunks',
|
|
||||||
} # str-typed keys
|
|
||||||
|
|
||||||
__slots__ = ("_dict", ) # avoid setting attributes not supported by properties
|
__slots__ = ("_dict", ) # avoid setting attributes not supported by properties
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue