Exceptions are unhandled when rendering a config template via the REST API #7857

Closed
opened 2025-12-29 20:29:04 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Apr 4, 2023).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.5-beta1

Python version

3.8

Steps to Reproduce

  1. Create a config template with the following code:
{{ foo|bar }}
  1. Assign the config template to a device
  2. Attempt to render the device's configuration by making a REST API call to the /api/dcim/devices/<id>/render-config/ endpoint

Expected Behavior

Rendering should fail and return an error message indicating the reason. (The template filter bar is invalid.)

Observed Behavior

A TemplateAssertionError exception is raised and not handled.

Originally created by @jeremystretch on GitHub (Apr 4, 2023). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.5-beta1 ### Python version 3.8 ### Steps to Reproduce 1. Create a config template with the following code: ``` {{ foo|bar }} ``` 2. Assign the config template to a device 3. Attempt to render the device's configuration by making a REST API call to the `/api/dcim/devices/<id>/render-config/` endpoint ### Expected Behavior Rendering should fail and return an error message indicating the reason. (The template filter `bar` is invalid.) ### Observed Behavior A `TemplateAssertionError` exception is raised and not handled.
adam added the type: bugstatus: acceptedbeta labels 2025-12-29 20:29:04 +01:00
adam closed this issue 2025-12-29 20:29:04 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7857