diff --git a/neutron_lib/exceptions/address_scope.py b/neutron_lib/exceptions/address_scope.py index ecc2a621e..c4d27e7c4 100644 --- a/neutron_lib/exceptions/address_scope.py +++ b/neutron_lib/exceptions/address_scope.py @@ -29,3 +29,8 @@ class AddressScopeInUse(exceptions.InUse): class AddressScopeUpdateError(exceptions.BadRequest): message = _("Unable to update address scope %(address_scope_id)s : " "%(reason)s.") + + +class NetworkAddressScopeAffinityError(exceptions.BadRequest): + message = _("Subnets of the same address family hosted on the same " + "network must all participate in the same address scope.") diff --git a/releasenotes/notes/add-network-address-scope-affinity-error-8f6b4493a92142d4.yaml b/releasenotes/notes/add-network-address-scope-affinity-error-8f6b4493a92142d4.yaml new file mode 100644 index 000000000..e04e8d268 --- /dev/null +++ b/releasenotes/notes/add-network-address-scope-affinity-error-8f6b4493a92142d4.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + A new exception named ``NetworkAddressScopeAffinityError`` has been added + in neutron_lib/exceptions/address_scope.py. This is to be raised by + consumers when network / address scope affinity constraints are violated + on subnet creation and subnet pool updates.