From ed361611e437eebf2c19491f9344cf13736d12c3 Mon Sep 17 00:00:00 2001 From: Arthur Date: Fri, 2 Feb 2024 07:21:02 -0800 Subject: [PATCH] 12510 main log results to empty string --- netbox/extras/scripts.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/netbox/extras/scripts.py b/netbox/extras/scripts.py index 11537e775..a40ac7c91 100644 --- a/netbox/extras/scripts.py +++ b/netbox/extras/scripts.py @@ -275,7 +275,7 @@ class BaseScript: def __init__(self): self._logs = {} self._failed = False - self._current_method = 'unassigned' + self._current_method = '' self._output = '' # Initiate the log @@ -285,7 +285,7 @@ class BaseScript: self.request = None # Compile test methods and initialize results skeleton - self._logs['unassigned'] = { + self._logs[''] = { 'success': 0, 'info': 0, 'warning': 0, @@ -456,8 +456,8 @@ class BaseScript: if log_level != LogLevelChoices.LOG_DEFAULT: self._logs[self._current_method][log_level] += 1 - if self._current_method != 'unassigned': - self._logs['unassigned'][log_level] += 1 + if self._current_method != '': + self._logs[''][log_level] += 1 if obj: self.logger.log(level, f"{log_level.capitalize()} | {obj}: {message}") @@ -526,10 +526,10 @@ class BaseScript: test_method() except Exception as e: self.post_run() - self._current_method = 'unassigned' + self._current_method = '' raise e - self._current_method = 'unassigned' + self._current_method = '' def run(self, data, commit): self.pre_run()