clan_lib: deprecate is_writeable_key

This commit is contained in:
Johannes Kirschbauer
2025-09-21 16:37:50 +02:00
parent 381c190ba2
commit 9a03644a80
3 changed files with 5 additions and 7 deletions

View File

@@ -24,10 +24,6 @@ from clan_lib.persist.static_data import (
from .util import (
path_match,
# calc_patches,
# delete_by_path,
# determine_writeability,
# set_value_by_path,
)

View File

@@ -362,7 +362,7 @@ def find_duplicates(string_list: list[str]) -> list[str]:
return [item for item, freq in count.items() if freq > 1]
def is_writeable_key(
def is_writeable_path(
key: PathTuple,
writeables: WriteabilityResult,
) -> bool:
@@ -386,7 +386,7 @@ def is_writeable_key(
def validate_writeability(path: PathTuple, writeables: WriteabilityResult) -> None:
"""Validate that a path is writeable."""
if not is_writeable_key(path, writeables):
if not is_writeable_path(path, writeables):
msg = f"Path '{path_to_string(path)}' is readonly. - It seems its value is statically defined in nix."
raise ClanError(msg)

View File

@@ -209,7 +209,9 @@ def is_writeable_key(
key: str,
writeables: dict[str, set[str]],
) -> bool:
"""Recursively check if a key is writeable.
"""@deprecated use 'static_data.is_writeable_path' instead.
Recursively check if a key is writeable.
key "machines.machine1.deploy.targetHost" is specified but writeability is only defined for "machines"
We pop the last key and check if the parent key is writeable/non-writeable.
"""