From d4415186690493c728e461d9bea9b32bfe246321 Mon Sep 17 00:00:00 2001 From: Ryan Tidwell Date: Wed, 26 Jun 2019 10:04:00 -0500 Subject: [PATCH] Introduce NetworkAddressScopeAffinityError This introduces NetworkAddressScopeAffinityError, which is to be raised when address scope affinity constraints on a network are violated. Change-Id: Id541059b8fe0ab74035819516f079d93bb76d43c Partial-Bug: 1830240 Implements: subnets-different-pools-same-net --- neutron_lib/exceptions/address_scope.py | 5 +++++ ...work-address-scope-affinity-error-8f6b4493a92142d4.yaml | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 releasenotes/notes/add-network-address-scope-affinity-error-8f6b4493a92142d4.yaml 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.