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

Fix Half U #133

Merged
merged 4 commits into from
Feb 16, 2024
Merged

Fix Half U #133

merged 4 commits into from
Feb 16, 2024

Conversation

snaselj
Copy link
Contributor

@snaselj snaselj commented Feb 15, 2024

Closes: NaN

What's Changed

  • Fixed importing non integer values for DeviceType.u_height.

To Do

@glennmatthews
Copy link
Contributor

How does this impact the racking of such devices? (IIRC 0U devices can't be assigned a rack position, so racked 0.5U devices may pose a problem for importing).

@snaselj snaselj mentioned this pull request Feb 15, 2024
2 tasks
@snaselj
Copy link
Contributor Author

snaselj commented Feb 15, 2024

How does this impact the racking of such devices? (IIRC 0U devices can't be assigned a rack position, so racked 0.5U devices may pose a problem for importing).

Thanks for clarification, what's your proposal on this pls.? Not sure whether remove rack assignment, fail, or try to round it to 1? Any other thoughts?

If the rack assignment would fail as a ValidationError, then it's safe to import. All ValidationErrors are gathered and printed.

@glennmatthews
Copy link
Contributor

Rounding up wouldn't be any better as you'd now have two 1U devices trying to occupy the same position in the rack, which would also be invalid. Possibly the best approach would be to round down u_height as you're doing, but also un-rack any devices that either result in a zero u_height or had a non-integer position in a rack. That way the devices themselves can still be imported successfully at least.

@snaselj snaselj marked this pull request as ready for review February 15, 2024 15:22
"is_custom": true,
"is_custom": false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is generated, don't want to change it manually.

Noticed this color field flapping. Want to fix it in a separate PR, not a real issue now.

color (DATA) (CUSTOM) => value_importer => color (CharField)
color (DATA) => value_importer => color (CharField)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is generated, don't want to change it manually.

Noticed this color field flapping. Want to fix it in a separate PR, not a real issue now.

Copy link
Contributor

@glennmatthews glennmatthews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I question the value of this fix in isolation without also addressing the racking issue, but looks fine for what it is.

@snaselj snaselj merged commit 4c875e5 into develop Feb 16, 2024
14 checks passed
@snaselj snaselj deleted the u/snaselj-halfu branch February 16, 2024 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants