Skip to content

Commit

Permalink
validation_utils: remove file content from ConfigValidationError str …
Browse files Browse the repository at this point in the history
…output

Change-Id: I483eee6eb4a4a6d8ae17c10fd846a90dd419508d
  • Loading branch information
anthonyh209 committed Dec 3, 2024
1 parent 5c9f722 commit ddd9405
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cmk/utils/config_validation_layer/validation_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ def __init__(
self.pydantic_error = pydantic_error

def __str__(self) -> str:
error_msg = f"""
{tty.red}Current config: '{self.which_file}'{tty.normal}
{pformat(self.original_data).replace('\n', '\n\t')}
\n\t{tty.red}Config errors ({self.pydantic_error.error_count()}){tty.normal}
"""
error_count = self.pydantic_error.error_count()
error_msg = (
f"{tty.red}{error_count} config error{'s' if error_count > 1 else ''}{tty.normal}\n\t"
)

for error in self.pydantic_error.errors():
error_msg += f'{(pformat(error)).replace("\n", "\n\t")}\n\n\t'
Expand Down

0 comments on commit ddd9405

Please sign in to comment.