Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
kkthxbye-code opened this issue Dec 6, 2023 · 0 comments
Assignees
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@kkthxbye-code
Copy link
Contributor

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).

@kkthxbye-code kkthxbye-code added the type: bug A confirmed report of unexpected behavior in the application label Dec 6, 2023
@jeremystretch jeremystretch added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation severity: low Does not significantly disrupt application functionality, or a workaround is available labels Dec 6, 2023
@jeremystretch jeremystretch self-assigned this Dec 6, 2023
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Dec 6, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants