ConfigContext doesn't evaluate parent locations #11578

Closed
opened 2025-12-29 21:47:05 +01:00 by adam · 1 comment
Owner

Originally created by @alehaa on GitHub (Sep 5, 2025).

Originally assigned to: @pheus on GitHub.

Deployment Type

Self-hosted

NetBox Version

v4.4.0

Python Version

3.11

Steps to Reproduce

  1. Create Location A with child location B
  2. Create a Device in location B
  3. Create a ConfigContext for location A

Expected Behavior

ConfigContext is evaluated for device.

Observed Behavior

ConfigContext will only be evaluated when applied directly to location B. Since this is an organizational model that allows nesting, I would assume that ancestors would be covered in the ConfigContextQuerySet, similar to how site groups, regions, and device roles are handled. A practical use case would be assigning configuration for a specific room divided into multiple sub-locations, such as datacenter pods.

Relevant code: https://github.com/netbox-community/netbox/blob/main/netbox/extras/querysets.py#L27

Originally created by @alehaa on GitHub (Sep 5, 2025). Originally assigned to: @pheus on GitHub. ### Deployment Type Self-hosted ### NetBox Version v4.4.0 ### Python Version 3.11 ### Steps to Reproduce 1. Create `Location` A with child location B 2. Create a `Device` in location B 3. Create a `ConfigContext` for location A ### Expected Behavior `ConfigContext` is evaluated for device. ### Observed Behavior ConfigContext will only be evaluated when applied directly to location B. Since this is an organizational model that allows nesting, I would assume that ancestors would be covered in the `ConfigContextQuerySet`, similar to how site groups, regions, and device roles are handled. A practical use case would be assigning configuration for a specific room divided into multiple sub-locations, such as datacenter pods. Relevant code: https://github.com/netbox-community/netbox/blob/main/netbox/extras/querysets.py#L27
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 21:47:05 +01:00
adam closed this issue 2025-12-29 21:47:05 +01:00
Author
Owner

@pheus commented on GitHub (Sep 7, 2025):

I'd like to contribute this feature. Can you please assign it to me? Thanks

@pheus commented on GitHub (Sep 7, 2025): I'd like to contribute this feature. Can you please assign it to me? Thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11578