mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2026-10-09 16:06:40 +00:00
merge: refresh runtime configuration PR 1305
This commit is contained in:
@@ -807,9 +807,7 @@ class ConfigEOS(SingletonMixin, SettingsEOSDefaults):
|
||||
)
|
||||
elif isinstance(setting, list):
|
||||
setting = [
|
||||
item.model_dump(
|
||||
exclude_none=True, exclude_unset=True, exclude_computed_fields=True
|
||||
)
|
||||
item.model_dump(exclude_none=True, exclude_unset=True, exclude_computed_fields=True)
|
||||
if isinstance(item, SettingsBaseModel)
|
||||
else item
|
||||
for item in setting
|
||||
|
||||
@@ -113,7 +113,6 @@ def merge_models(source: BaseModel, update_dict: dict[str, Any]) -> dict[str, An
|
||||
Returns:
|
||||
dict[str, Any]: Merged dictionary representing combined model data.
|
||||
"""
|
||||
|
||||
source_dict = source.model_dump(
|
||||
exclude_unset=True,
|
||||
exclude_computed_fields=True,
|
||||
|
||||
@@ -81,8 +81,7 @@ def validate_ip_or_hostname(value: str) -> str:
|
||||
raise ValueError(f"Not a valid hostname: {value}")
|
||||
|
||||
hostname_regex = re.compile(
|
||||
r"^(?=.{1,253}$)(?!-)[A-Z\d-]{1,63}(?<!-)"
|
||||
r"(?:\.(?!-)[A-Z\d-]{1,63}(?<!-))*\.?$",
|
||||
r"^(?=.{1,253}$)(?!-)[A-Z\d-]{1,63}(?<!-)" r"(?:\.(?!-)[A-Z\d-]{1,63}(?<!-))*\.?$",
|
||||
re.IGNORECASE,
|
||||
)
|
||||
if not bool(hostname_regex.fullmatch(value)):
|
||||
|
||||
Reference in New Issue
Block a user