1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00
Arthur Hanson ca2ee436a0 Closes #14438: Database representation of scripts
- Introduces the Script model to represent individual Python classes within a ScriptModule file
- Automatically migrates jobs & event rules

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-02-23 08:27:37 -05:00

35 lines
938 B
Python

from .choices import LogLevelChoices
from .scripts import BaseScript
__all__ = (
'Report',
)
# Required by extras/migrations/0109_script_models.py
class Report(BaseScript):
#
# Legacy logging methods for Reports
#
# There is no generic log() equivalent on BaseScript
def log(self, message):
self._log(message, None, level=LogLevelChoices.LOG_DEFAULT)
def log_success(self, obj=None, message=None):
super().log_success(message, obj)
def log_info(self, obj=None, message=None):
super().log_info(message, obj)
def log_warning(self, obj=None, message=None):
super().log_warning(message, obj)
def log_failure(self, obj=None, message=None):
super().log_failure(message, obj)
# Added in v4.0 to avoid confusion with the log_debug() method provided by BaseScript
def log_debug(self, obj=None, message=None):
super().log_debug(message, obj)