mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-16 12:38:17 -06:00
Fixes: #3519 - Disallow(API) connections to virtual & wireless interfaces
This commit is contained in:
parent
6fdd35785e
commit
aed144fc19
@ -2868,6 +2868,30 @@ class Cable(ChangeLoggedModel):
|
|||||||
(
|
(
|
||||||
isinstance(endpoint_b, Interface) and
|
isinstance(endpoint_b, Interface) and
|
||||||
endpoint_b.type == IFACE_TYPE_VIRTUAL
|
endpoint_b.type == IFACE_TYPE_VIRTUAL
|
||||||
|
) or
|
||||||
|
(
|
||||||
|
isinstance(self.termination_a, Interface) and
|
||||||
|
self.termination_a.type == IFACE_TYPE_VIRTUAL
|
||||||
|
) or
|
||||||
|
(
|
||||||
|
isinstance(self.termination_b, Interface) and
|
||||||
|
self.termination_b.type == IFACE_TYPE_VIRTUAL
|
||||||
|
) or
|
||||||
|
(
|
||||||
|
isinstance(endpoint_b, Interface) and
|
||||||
|
endpoint_b.type in WIRELESS_IFACE_TYPES
|
||||||
|
) or
|
||||||
|
(
|
||||||
|
isinstance(endpoint_b, Interface) and
|
||||||
|
endpoint_b.type in WIRELESS_IFACE_TYPES
|
||||||
|
) or
|
||||||
|
(
|
||||||
|
isinstance(self.termination_a, Interface) and
|
||||||
|
self.termination_a.type in WIRELESS_IFACE_TYPES
|
||||||
|
) or
|
||||||
|
(
|
||||||
|
isinstance(self.termination_b, Interface) and
|
||||||
|
self.termination_b.type in WIRELESS_IFACE_TYPES
|
||||||
)
|
)
|
||||||
):
|
):
|
||||||
raise ValidationError("Cannot connect to a virtual interface")
|
raise ValidationError("Cannot connect to a virtual interface")
|
||||||
|
Loading…
Reference in New Issue
Block a user