-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Zero length cable should be treated as a 0 length cable and not an unknown length cable #13649
Comments
I came across this while setting up splice boxes using rear ports and front ports. When you set a "0" value for the length, the cable is treated as unknown value and the cable trace shows "approximately". While there is a nominal (1µm perhaps) of distance added to a splice, it doesn't need to be taken into account, however the distance being accurate is important for reporting purposes (did we miss putting in a length or is it just the "0 length" item). Underlying this is the API, which reports "None" instead of "0" for the CablePath.get_total_length() method. |
I think the underlying issue here is that a cable should not be permitted to have a zero length. |
I think there are instances (like I said, when you aren't doing actual cables, but documenting "splices" where a 0-length is going to be desireable. Until we start adding the ability to account for splicing, I think we should allow "0 length" cables and switch to checking for null instead of "not-empty (catches zero as a value)" in 3 places:
Right now, _abs_length of the cable gets saves as "none" while the actual cable length is 0.0 m The API is fine as it returns "0.0 m" A migration would l likely be required to account for those non-zero values in the code and resave _abs_length |
But a splice isn't a cable, and attempting to model it as one violates our tenet of replicating the real world. You're certainly welcome to submit a feature request proposing this ability, but as far as this bug goes IMO the solution is to invalidate zero-length cables. |
I wanted to chime in on this discussion, and I find myself in alignment with @DanSheps regarding the documentation of splice trays and their interconnections. This approach, using "0" and "None," brings clarity to network configurations involving devices with pigtails and splice ports. Let me elaborate further: Device Configuration: Splicing in Devices: The Significance of "0" and "None":
By adopting this notation, we can maintain consistency in our documentation practices and provide a clear understanding of these specific network configurations. It not only aids in the 80/20 principle of NetBox but also ensures that we accurately represent the physical network infrastructure. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide. |
Given the closure of #13375 having clarity on this point would be useful. I also see the value in modeling breakout cables using 0-length splices (vs. None). If a different approach is preferred could we change this issue into a documentation one? |
We discussed this on the maintainers call today. Let's proceed with respecting zero-length cables, and make the necessary changes to the length calculation logic. |
NetBox version
v3.6.0
Python version
3.8
Steps to Reproduce
Expected Behavior
Observed Behavior
The text was updated successfully, but these errors were encountered: