mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-09 01:49:35 -06:00
Fixes #20197: Correct validation for virtual chassis parent interface (#20337)
Some checks are pending
CI / build (20.x, 3.10) (push) Waiting to run
CI / build (20.x, 3.11) (push) Waiting to run
CI / build (20.x, 3.12) (push) Waiting to run
CodeQL / Analyze (${{ matrix.language }}) (none, actions) (push) Waiting to run
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Waiting to run
Some checks are pending
CI / build (20.x, 3.10) (push) Waiting to run
CI / build (20.x, 3.11) (push) Waiting to run
CI / build (20.x, 3.12) (push) Waiting to run
CodeQL / Analyze (${{ matrix.language }}) (none, actions) (push) Waiting to run
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Waiting to run
This commit is contained in:
parent
4b17faae52
commit
103939ad3c
@ -872,14 +872,14 @@ class Interface(ModularComponentModel, BaseInterface, CabledObjectModel, PathEnd
|
|||||||
"The selected parent interface ({interface}) belongs to a different device ({device})"
|
"The selected parent interface ({interface}) belongs to a different device ({device})"
|
||||||
).format(interface=self.parent, device=self.parent.device)
|
).format(interface=self.parent, device=self.parent.device)
|
||||||
})
|
})
|
||||||
elif self.parent.device.virtual_chassis != self.parent.virtual_chassis:
|
elif self.parent.device.virtual_chassis != self.device.virtual_chassis:
|
||||||
raise ValidationError({
|
raise ValidationError({
|
||||||
'parent': _(
|
'parent': _(
|
||||||
"The selected parent interface ({interface}) belongs to {device}, which is not part of "
|
"The selected parent interface ({interface}) belongs to {device}, which is not part of "
|
||||||
"virtual chassis {virtual_chassis}."
|
"virtual chassis {virtual_chassis}."
|
||||||
).format(
|
).format(
|
||||||
interface=self.parent,
|
interface=self.parent,
|
||||||
device=self.parent_device,
|
device=self.parent.device,
|
||||||
virtual_chassis=self.device.virtual_chassis
|
virtual_chassis=self.device.virtual_chassis
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@ -890,7 +890,7 @@ class Interface(ModularComponentModel, BaseInterface, CabledObjectModel, PathEnd
|
|||||||
if self.pk and self.bridge_id == self.pk:
|
if self.pk and self.bridge_id == self.pk:
|
||||||
raise ValidationError({'bridge': _("An interface cannot be bridged to itself.")})
|
raise ValidationError({'bridge': _("An interface cannot be bridged to itself.")})
|
||||||
|
|
||||||
# A bridged interface belong to the same device or virtual chassis
|
# A bridged interface belongs to the same device or virtual chassis
|
||||||
if self.bridge and self.bridge.device != self.device:
|
if self.bridge and self.bridge.device != self.device:
|
||||||
if self.device.virtual_chassis is None:
|
if self.device.virtual_chassis is None:
|
||||||
raise ValidationError({
|
raise ValidationError({
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user