Change exception types in network_segment_range

This patch changes the exception types defined for network_segment_range
service plugin to ensure that they return Client Error (HTTP status code
4xx) to client.

Co-authored-by: Allain Legacy <Allain.legacy@windriver.com>

Partially-implements: blueprint network-segment-range-management
Change-Id: I4f2fbcbc7e88067e0cc7c3391cab7bf30fb39354
This commit is contained in:
Kailun Qin 2019-03-05 07:23:33 +08:00
parent f93fb1e2ae
commit 907c1d8a59
1 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ from neutron_lib._i18n import _
from neutron_lib import exceptions
class NetworkSegmentRangeNetTypeNotSupported(exceptions.NeutronException):
class NetworkSegmentRangeNetTypeNotSupported(exceptions.BadRequest):
message = _("Network type %(type)s does not support "
"network segment ranges.")
@ -25,12 +25,12 @@ class NetworkSegmentRangeNotFound(exceptions.NotFound):
message = _("Network Segment Range %(range_id)s could not be found.")
class NetworkSegmentRangeReferencedByProject(exceptions.NeutronException):
class NetworkSegmentRangeReferencedByProject(exceptions.InUse):
message = _("Network Segment Range %(range_id)s is referenced by "
"one or more tenant networks.")
class NetworkSegmentRangeDefaultReadOnly(exceptions.NeutronException):
class NetworkSegmentRangeDefaultReadOnly(exceptions.BadRequest):
message = _("Network Segment Range %(range_id)s is a "
"default segment range which could not be updated or deleted.")