From 364f20f620045ee58096ddc34bac764da0d3e057 Mon Sep 17 00:00:00 2001 From: Arthur Date: Thu, 4 May 2023 12:00:45 -0700 Subject: [PATCH] 12416 update from review feedback --- netbox/extras/models/scripts.py | 4 ++++ netbox/templates/extras/script_list.html | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/netbox/extras/models/scripts.py b/netbox/extras/models/scripts.py index 154bd565f..de48aae8e 100644 --- a/netbox/extras/models/scripts.py +++ b/netbox/extras/models/scripts.py @@ -1,4 +1,5 @@ import inspect +import logging from functools import cached_property from django.db import models @@ -16,6 +17,8 @@ __all__ = ( 'ScriptModule', ) +logger = logging.getLogger('netbox.data_backends') + class Script(WebhooksMixin, models.Model): """ @@ -56,6 +59,7 @@ class ScriptModule(PythonModuleMixin, JobsMixin, ManagedFile): try: module = self.get_module() except Exception as e: + logger.debug(f"Failed to load script: {self.python_name} error: {e}") module = None scripts = {} diff --git a/netbox/templates/extras/script_list.html b/netbox/templates/extras/script_list.html index 0b42f9884..9a67e2b10 100644 --- a/netbox/templates/extras/script_list.html +++ b/netbox/templates/extras/script_list.html @@ -39,9 +39,7 @@ {% include 'inc/sync_warning.html' with object=module %} {% if not module.scripts %} {% else %}