From 5ca8c07443dc01ffb06506405687ff3d10432a2f Mon Sep 17 00:00:00 2001 From: Elvira Garcia Date: Mon, 29 Jun 2026 15:14:17 +0200 Subject: [PATCH] Fix error handling in PVLAN PVLAN incorrectly handled 400 Bad Request errors as 500 Internal Server errors. Replacing NeutronException with BadRequest exception fixes this issue. Closes-Bug: #2158628 Change-Id: Ie674c8388fd415bf5b4e834e35311d273520f41b Signed-off-by: Elvira Garcia --- neutron/services/pvlan/exceptions.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/neutron/services/pvlan/exceptions.py b/neutron/services/pvlan/exceptions.py index ed601bfbfd8..676858545ef 100644 --- a/neutron/services/pvlan/exceptions.py +++ b/neutron/services/pvlan/exceptions.py @@ -18,38 +18,38 @@ from neutron_lib import exceptions as n_exc from neutron._i18n import _ -class PVLANNotEnabledOnNetwork(n_exc.NeutronException): +class PVLANNotEnabledOnNetwork(n_exc.BadRequest): message = _('PVLAN is not enabled on network %(network_id)s.') -class PVLANCannotSetCommunityName(n_exc.NeutronException): +class PVLANCannotSetCommunityName(n_exc.BadRequest): message = _( 'PVLAN community name cannot be set if port type is not ' '"community" for this port: %(port_id)s.' ) -class PVLANCommunityNameRequired(n_exc.NeutronException): +class PVLANCommunityNameRequired(n_exc.BadRequest): message = _( 'Community name is required for ports with PVLAN type ' '"community": %(port_id)s.' ) -class PVLANPortSecurityDisabled(n_exc.NeutronException): +class PVLANPortSecurityDisabled(n_exc.BadRequest): message = _( 'Port security is disabled for port %(port_id)s, cannot set PVLAN.' ) -class PVLANNetworkPortSecurityDisabled(n_exc.NeutronException): +class PVLANNetworkPortSecurityDisabled(n_exc.BadRequest): message = _( 'Port security is disabled on network %(network_id)s, ' 'cannot enable PVLAN.' ) -class PVLANUnsupportedType(n_exc.NeutronException): +class PVLANUnsupportedType(n_exc.BadRequest): message = _( 'Unsupported PVLAN type %(pvlan_type)s for port %(port_id)s.' )