Disallow deletion of physical port if there are objects depending on it
NetBox version
3.5.7
Feature type
Change to existing functionality
Proposed functionality
User should not be able to delete a physical port if:
- port has cable attached
- port is parent to other interfaces such as LAG and virtual child interfaces
Every attempt to delete a port under those circumstances should result in "denied" message with text "port in use" or similar. If possible message should show objects that are blocking deletion, similar to another FR that has been accepted.
Use case
In my opinion this is fundamental feature of a system like Netbox where you need to keep your data in order. There should be a natural hierarchy of elements that are depending on each other. Just like you cannot remove site if there are devices assigned to it.
This would keep objects safe from accidental removal and possible nightmare with orphan objects.
Database changes
not sure
External dependencies
none
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.
While I can appreciate the use case, there are valid competing use cases that depend on the current behavior. NetBox v3.7 extended the deletion confirmation dialog so that it now lists any dependent objects that will also be deleted as a consequence of deleting the primary object (see #13690). This provides a nice compromise to help safeguard against inadvertent deletions without inhibiting workflows which depend on cascading object deletions.