mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-18 05:28:16 -06:00
12510 main log results to empty string
This commit is contained in:
parent
c9f8b78048
commit
ed361611e4
@ -275,7 +275,7 @@ class BaseScript:
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._logs = {}
|
self._logs = {}
|
||||||
self._failed = False
|
self._failed = False
|
||||||
self._current_method = 'unassigned'
|
self._current_method = ''
|
||||||
self._output = ''
|
self._output = ''
|
||||||
|
|
||||||
# Initiate the log
|
# Initiate the log
|
||||||
@ -285,7 +285,7 @@ class BaseScript:
|
|||||||
self.request = None
|
self.request = None
|
||||||
|
|
||||||
# Compile test methods and initialize results skeleton
|
# Compile test methods and initialize results skeleton
|
||||||
self._logs['unassigned'] = {
|
self._logs[''] = {
|
||||||
'success': 0,
|
'success': 0,
|
||||||
'info': 0,
|
'info': 0,
|
||||||
'warning': 0,
|
'warning': 0,
|
||||||
@ -456,8 +456,8 @@ class BaseScript:
|
|||||||
if log_level != LogLevelChoices.LOG_DEFAULT:
|
if log_level != LogLevelChoices.LOG_DEFAULT:
|
||||||
self._logs[self._current_method][log_level] += 1
|
self._logs[self._current_method][log_level] += 1
|
||||||
|
|
||||||
if self._current_method != 'unassigned':
|
if self._current_method != '':
|
||||||
self._logs['unassigned'][log_level] += 1
|
self._logs[''][log_level] += 1
|
||||||
|
|
||||||
if obj:
|
if obj:
|
||||||
self.logger.log(level, f"{log_level.capitalize()} | {obj}: {message}")
|
self.logger.log(level, f"{log_level.capitalize()} | {obj}: {message}")
|
||||||
@ -526,10 +526,10 @@ class BaseScript:
|
|||||||
test_method()
|
test_method()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.post_run()
|
self.post_run()
|
||||||
self._current_method = 'unassigned'
|
self._current_method = ''
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
self._current_method = 'unassigned'
|
self._current_method = ''
|
||||||
|
|
||||||
def run(self, data, commit):
|
def run(self, data, commit):
|
||||||
self.pre_run()
|
self.pre_run()
|
||||||
|
Loading…
Reference in New Issue
Block a user