Skip to content

Exception thrown when creating a power feed with a rack located on a different site than the power panel. #14448

@kkthxbye-code

Description

@kkthxbye-code

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.

  1. Create power feed
  2. Choose power panel on site x
  3. Choose rack on site y
  4. Save

Expected Behavior

No exception

Observed Behavior

<class 'KeyError'>

'site'

# 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 availablestatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions