mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-17 21:18:16 -06:00
Fix formatting of script logs
This commit is contained in:
parent
8a570ec52d
commit
da5eb0bb62
@ -442,6 +442,7 @@ class BaseScript:
|
|||||||
# A test method is currently active, so log the message using legacy Report logging
|
# A test method is currently active, so log the message using legacy Report logging
|
||||||
if self._current_method:
|
if self._current_method:
|
||||||
|
|
||||||
|
# TODO: Use a dataclass for test method logs
|
||||||
self.tests[self._current_method]['log'].append((
|
self.tests[self._current_method]['log'].append((
|
||||||
timezone.now().isoformat(),
|
timezone.now().isoformat(),
|
||||||
level,
|
level,
|
||||||
@ -457,9 +458,10 @@ class BaseScript:
|
|||||||
elif message:
|
elif message:
|
||||||
|
|
||||||
# Record to the script's log
|
# Record to the script's log
|
||||||
self.messages.append(
|
self.messages.append({
|
||||||
(level, str(message))
|
'status': level,
|
||||||
)
|
'message': str(message),
|
||||||
|
})
|
||||||
|
|
||||||
# Record to the system log
|
# Record to the system log
|
||||||
if obj:
|
if obj:
|
||||||
|
Loading…
Reference in New Issue
Block a user