Skip to content

Commit

Permalink
No validation
Browse files Browse the repository at this point in the history
  • Loading branch information
pederhan committed Aug 10, 2023
1 parent 3933fd6 commit 408a9c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion zabbix_auto_config/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class Host(BaseModel):
siteadmins: Set[str] = set()
sources: Set[str] = set()
tags: Set[Tuple[str, str]] = set()
model_config = ConfigDict(validate_assignment=True, revalidate_instances="always")
model_config = ConfigDict(validate_assignment=True)

@model_validator(mode="before")
@classmethod
Expand Down
3 changes: 1 addition & 2 deletions zabbix_auto_config/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,7 @@ def handle_host(
assert (
host.hostname == modified_host.hostname
), f"Modifier changed the hostname, '{host.hostname}' -> '{modified_host.hostname}'"
# Re-validate the host after modification
host = host.model_validate(modified_host)
host = modified_host
except AssertionError as e:
logging.warning(
"Host, '%s', was modified to be invalid by modifier: '%s'. Error: %s",
Expand Down

0 comments on commit 408a9c3

Please sign in to comment.