Component
Python SDK, Git Integration
Infrahub version
1.7.1 (2413b7c)
Current Behavior
The following code in a check:
class MyCheck(InfrahubCheck):
def validate(self, data: dict) -> None:
[...redacted...]
message = (
f"Duplicate serial '{serial}' for manufacturer '{manufacturer_name}'. "
f"Assets: '{first['tag']}' and '{asset_tag}'."
)
self.log_error(message=message, object_id=asset_id, object_type="DcimDeviceAsset")
Results in this (truncated, as it goes for quite a while) log message:
It appears to be caused by InfrahubCheck.log_entries @ https://github.com/opsmill/infrahub-sdk-python/blob/d116aa39c2f739d1fc96af26679bc2e0087b43d9/infrahub_sdk/checks.py#L120-L131
...which returns a string that backend.infrahub.git.tasks:run_user_check then iterates over, emitting one character per line.
Expected Behavior
Emit one log entry per line.
Steps to Reproduce
- Create a Check which emits a log entry
- Trigger the check; in my testing, I submitted a proposed change (Draft)
Additional Information
No response
Component
Python SDK, Git Integration
Infrahub version
1.7.1 (2413b7c)
Current Behavior
The following code in a check:
Results in this (truncated, as it goes for quite a while) log message:
It appears to be caused by InfrahubCheck.log_entries @ https://github.com/opsmill/infrahub-sdk-python/blob/d116aa39c2f739d1fc96af26679bc2e0087b43d9/infrahub_sdk/checks.py#L120-L131
...which returns a string that backend.infrahub.git.tasks:run_user_check then iterates over, emitting one character per line.
Expected Behavior
Emit one log entry per line.
Steps to Reproduce
Additional Information
No response