1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

#12081: Script & report cleanup (#12091)

* start() and terminate() methods on Job should call save()

* Fix display of associated jobs

* Introduce get_latest_jobs() method on JobsMixin

* Update messaging when no reports/scripts exist

* Catch ImportErrors when rendering report/script lists

* Fix loading of nested modules

* Fix URLs for nested scripts/reports
This commit is contained in:
Jeremy Stretch
2023-03-29 16:51:55 -04:00
committed by GitHub
parent 177668dca5
commit 715592547c
11 changed files with 130 additions and 131 deletions

View File

@@ -195,8 +195,6 @@ class Report(object):
Run the report and save its results. Each test method will be executed in order.
"""
self.logger.info(f"Running report")
job.status = JobStatusChoices.STATUS_RUNNING
job.save()
# Perform any post-run tasks
self.pre_run()
@@ -218,6 +216,7 @@ class Report(object):
logger.error(f"Exception raised during report execution: {e}")
job.terminate(status=JobStatusChoices.STATUS_ERRORED)
finally:
job.data = self._results
job.terminate()
# Perform any post-run tasks