Skip to content

Apply all registered request processors when running custom scripts #18224

Closed
@jeremystretch

Description

@jeremystretch

NetBox version

v4.1.8

Feature type

Change to existing functionality

Triage priority

I volunteer to perform this work (if approved)

Proposed functionality

When a custom script is run (as a background job), currently only the event_tracking request processor is employed:

# Execute the script. If commit is True, wrap it with the event_tracking context manager to ensure we process
# change logging, event rules, etc.
with event_tracking(request) if commit else nullcontext():
self.run_script(script, request, data, commit)

All registered request processors should be applied here, not just event_tracking.

Use case

FR #18211 recently introduced the ability to dynamically register request processors (a planned feature for the plugins API). This change will ensure that any additional registered processors are run when executing custom scripts as well as when servicing requests.

Database changes

N/A

External dependencies

N/A

Metadata

Metadata

Assignees

Labels

complexity: lowRequires minimal effort to implementstatus: acceptedThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions