POST /api/extras/config-templates/ request does not load template from data_file #10948

Closed
opened 2025-12-29 21:38:12 +01:00 by adam · 3 comments
Owner

Originally created by @TheNerdyHamster on GitHub (Mar 25, 2025).

Deployment Type

Self-hosted

NetBox Version

v4.2.6

Python Version

3.12

Steps to Reproduce

  1. Set up a data source (tested with local filesystem and git).
  2. Create a new config template using the data source and a specific data_file.

Example POST request to /api/extras/config-templates/:

{
  "name": "Test template",
  "template_code": "{{ template }}",
  "data_source": {
    "name": "test"
  },
  "data_file": {
    "path": "test"
  }
}
  1. View the config template and you will see the raw template_code value {{ template }}, not the rendered content from the data_file.
  2. Edit the config template (without making any changes) and click save.
  3. After saving, the template is now rendered correctly from the datasource file.

Expected Behavior

The template content should be rendered from the data_file immediately after creation, without needing a manual update.

Observed Behavior

Initially, the config template shows the value from template_code instead of loading the actual template from the datasource file. Only after editing/saving does it correctly load from the datasource.

Originally created by @TheNerdyHamster on GitHub (Mar 25, 2025). ### Deployment Type Self-hosted ### NetBox Version v4.2.6 ### Python Version 3.12 ### Steps to Reproduce 1. Set up a data source (tested with local filesystem and git). 2. Create a new config template using the data source and a specific `data_file`. Example POST request to `/api/extras/config-templates/`: ```json { "name": "Test template", "template_code": "{{ template }}", "data_source": { "name": "test" }, "data_file": { "path": "test" } } ``` 3. View the config template and you will see the raw `template_code` value `{{ template }}`, not the rendered content from the `data_file`. 4. Edit the config template (without making any changes) and click save. 5. After saving, the template is now rendered correctly from the datasource file. ### Expected Behavior The template content should be rendered from the `data_file` immediately after creation, without needing a manual update. ### Observed Behavior Initially, the config template shows the value from `template_code` instead of loading the actual template from the datasource file. Only after editing/saving does it correctly load from the datasource.
adam added the type: bugpending closurestatus: revisions needed labels 2025-12-29 21:38:12 +01:00
adam closed this issue 2025-12-29 21:38:13 +01:00
Author
Owner

@arthanson commented on GitHub (Mar 28, 2025):

@TheNerdyHamster Can you please provide the sample config template you are using what fields you are using. The information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken.

@arthanson commented on GitHub (Mar 28, 2025): @TheNerdyHamster Can you please provide the sample config template you are using what fields you are using. The information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken.
Author
Owner

@github-actions[bot] commented on GitHub (Apr 5, 2025):

This is a reminder that additional information is needed in order to further triage this issue. If the requested details are not provided, the issue will soon be closed automatically.

@github-actions[bot] commented on GitHub (Apr 5, 2025): This is a reminder that additional information is needed in order to further triage this issue. If the requested details are not provided, the issue will soon be closed automatically.
Author
Owner

@github-actions[bot] commented on GitHub (Apr 13, 2025):

This issue is being closed as no further information has been provided. If you would like to revisit this topic, please first modify your original post to include all the requested detail, and then ask that the issue be reopened.

@github-actions[bot] commented on GitHub (Apr 13, 2025): This issue is being closed as no further information has been provided. If you would like to revisit this topic, please first modify your original post to include all the requested detail, and then ask that the issue be reopened.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10948