mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 17:08:41 -06:00
Fix logger for ScriptJob
This commit is contained in:
parent
7d15ec0bbb
commit
9f1989c179
@ -33,6 +33,9 @@ class ScriptJob(BackgroundJob):
|
|||||||
data: A dictionary of data to be passed to the script upon execution
|
data: A dictionary of data to be passed to the script upon execution
|
||||||
commit: Passed through to Script.run()
|
commit: Passed through to Script.run()
|
||||||
"""
|
"""
|
||||||
|
logger = logging.getLogger(f"netbox.scripts.{script.full_name}")
|
||||||
|
logger.info(f"Running script (commit={commit})")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
try:
|
try:
|
||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
@ -87,9 +90,6 @@ class ScriptJob(BackgroundJob):
|
|||||||
"""
|
"""
|
||||||
script = ScriptModel.objects.get(pk=job.object_id).python_class()
|
script = ScriptModel.objects.get(pk=job.object_id).python_class()
|
||||||
|
|
||||||
logger = logging.getLogger(f"netbox.scripts.{script.full_name}")
|
|
||||||
logger.info(f"Running script (commit={commit})")
|
|
||||||
|
|
||||||
# Add files to form data
|
# Add files to form data
|
||||||
if request:
|
if request:
|
||||||
files = request.FILES
|
files = request.FILES
|
||||||
|
Loading…
Reference in New Issue
Block a user