-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
severity: lowDoes not significantly disrupt application functionality, or a workaround is availableDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Description
NetBox version
v3.6.6
Python version
3.11
Steps to Reproduce
I'll do very light replication steps here as the error is very obvious in the code (missing variable), hope that's okay.
- Create power feed
- Choose power panel on site x
- Choose rack on site y
- Save
Expected Behavior
No exception
Observed Behavior
<class 'KeyError'>
'site'
netbox/netbox/dcim/models/power.py
Lines 175 to 184 in d10ac9b
| # Rack must belong to same Site as PowerPanel | |
| if self.rack and self.rack.site != self.power_panel.site: | |
| raise ValidationError(_( | |
| "Rack {rack} ({site}) and power panel {powerpanel} ({powerpanel_site}) are in different sites" | |
| ).format( | |
| rack=self.rack, | |
| rack_site=self.rack.site, | |
| powerpanel=self.power_panel, | |
| powerpanel_site=self.power_panel.site | |
| )) |
{site} is present in the format string, but not in the format arguments (called rack_site instead).
Metadata
Metadata
Assignees
Labels
severity: lowDoes not significantly disrupt application functionality, or a workaround is availableDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application