mirror of
https://github.com/netinvent/npbackup.git
synced 2025-10-26 21:36:30 +08:00
Fix inheritance check in dicts
This commit is contained in:
parent
e594ac2ebd
commit
5fb2c5ccf5
1 changed files with 18 additions and 8 deletions
|
|
@ -514,7 +514,12 @@ def get_repo_config(
|
|||
_repo_config.s(key, merged_lists)
|
||||
_config_inheritance.s(key, {})
|
||||
for v in merged_lists:
|
||||
if v in _group_config.g(key):
|
||||
_grp_conf = _group_config.g(key)
|
||||
# Make sure we test inheritance against possible lists
|
||||
if not isinstance(_grp_conf, list):
|
||||
_grp_conf = [_grp_conf]
|
||||
for _grp_conf_item in _grp_conf:
|
||||
if v in _grp_conf_item:
|
||||
_config_inheritance.s(f"{key}.{v}", True)
|
||||
else:
|
||||
_config_inheritance.s(f"{key}.{v}", False)
|
||||
|
|
@ -546,7 +551,12 @@ def get_repo_config(
|
|||
|
||||
_config_inheritance.s(key, {})
|
||||
for v in merged_lists:
|
||||
if v in _group_config.g(key):
|
||||
_grp_conf = _group_config.g(key)
|
||||
# Make sure we test inheritance against possible lists
|
||||
if not isinstance(_grp_conf, list):
|
||||
_grp_conf = [_grp_conf]
|
||||
for _grp_conf_item in _grp_conf:
|
||||
if v in _grp_conf_item:
|
||||
_config_inheritance.s(f"{key}.{v}", True)
|
||||
else:
|
||||
_config_inheritance.s(f"{key}.{v}", False)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue