[PR #17293] [CLOSED] Fixes: 17292 - Detect infinite loop condition while iterating terminations in CablePath.from_origin #15047

Closed
opened 2025-12-30 00:19:39 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/17293
Author: @bctiemann
Created: 8/28/2024
Status: Closed

Base: developHead: 17292-detect-infinite-loop-in-cable-trace


📝 Commits (10+)

  • 3aaf5bb Detect infinite loop condition while iterating terminations in CablePath.from_origin
  • b027ff8 Add unit test for infinite loop detection
  • 11237c6 Merge remote-tracking branch 'origin/develop' into 17292-detect-infinite-loop-in-cable-trace
  • 92a96a3 More elegant and comprehensive way to detect if a cable is already in the path
  • 6a42ca3 Add max_length param to from_origin to support testing
  • cdf7aa1 Test from_origin directly
  • bfe6d39 Move CABLE_TRACE_MAX_LENGTH to settings
  • 4626649 Remove max_length from signals/outer functions
  • 19076fe Cleanup
  • b8545d2 Merge branch 'develop' into 17292-detect-infinite-loop-in-cable-trace

📊 Changes

3 files changed (+65 additions, -3 deletions)

View changed files

📝 netbox/dcim/models/cables.py (+11 -3)
📝 netbox/dcim/tests/test_cablepaths.py (+53 -0)
📝 netbox/netbox/settings.py (+1 -0)

📄 Description

Fixes: #17292

Adds a check to Step 4 of CablePath.from_origin to make sure the path length is not exceeding CABLE_TRACE_MAX_LENGTH (a new setting).

Also adds an optional max_length parameter to from_origin for use as a testing hook, to determine whether the loop detection is working.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/17293 **Author:** [@bctiemann](https://github.com/bctiemann) **Created:** 8/28/2024 **Status:** ❌ Closed **Base:** `develop` ← **Head:** `17292-detect-infinite-loop-in-cable-trace` --- ### 📝 Commits (10+) - [`3aaf5bb`](https://github.com/netbox-community/netbox/commit/3aaf5bb342a0058d1f8832b173ec37aa11aea182) Detect infinite loop condition while iterating terminations in CablePath.from_origin - [`b027ff8`](https://github.com/netbox-community/netbox/commit/b027ff85943431f566b626e6300692bcbc1057e6) Add unit test for infinite loop detection - [`11237c6`](https://github.com/netbox-community/netbox/commit/11237c67364de62497fb5b38f6cfd713301370ec) Merge remote-tracking branch 'origin/develop' into 17292-detect-infinite-loop-in-cable-trace - [`92a96a3`](https://github.com/netbox-community/netbox/commit/92a96a38d06c10b42d2c62b5e5a6f46ce6bf9f9c) More elegant and comprehensive way to detect if a cable is already in the path - [`6a42ca3`](https://github.com/netbox-community/netbox/commit/6a42ca3ff20ab2e0160085c06d6b1e3fae586277) Add max_length param to from_origin to support testing - [`cdf7aa1`](https://github.com/netbox-community/netbox/commit/cdf7aa1ea59b0ba818d5f4247ca5199ae2a32839) Test from_origin directly - [`bfe6d39`](https://github.com/netbox-community/netbox/commit/bfe6d393a7776f3d46342408698d0938964fc35c) Move CABLE_TRACE_MAX_LENGTH to settings - [`4626649`](https://github.com/netbox-community/netbox/commit/4626649754ef43d3a424b8efbf1c1e25b858f900) Remove max_length from signals/outer functions - [`19076fe`](https://github.com/netbox-community/netbox/commit/19076fe43c6009b7a1c6351de7f7acdc5c4048b2) Cleanup - [`b8545d2`](https://github.com/netbox-community/netbox/commit/b8545d2ff64564357ef694341e1b64e6854de0e2) Merge branch 'develop' into 17292-detect-infinite-loop-in-cable-trace ### 📊 Changes **3 files changed** (+65 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/models/cables.py` (+11 -3) 📝 `netbox/dcim/tests/test_cablepaths.py` (+53 -0) 📝 `netbox/netbox/settings.py` (+1 -0) </details> ### 📄 Description ### Fixes: #17292 Adds a check to Step 4 of `CablePath.from_origin` to make sure the path length is not exceeding `CABLE_TRACE_MAX_LENGTH` (a new setting). Also adds an optional `max_length` parameter to `from_origin` for use as a testing hook, to determine whether the loop detection is working. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:19:39 +01:00
adam closed this issue 2025-12-30 00:19:39 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15047