From 25728955c9f087e8f690ac8bf8386f868e36d0f1 Mon Sep 17 00:00:00 2001 From: Frode Nordahl Date: Tue, 29 Aug 2023 11:30:04 +0200 Subject: [PATCH] Patch apidef for BFD/ECMP extra attributes The 'enable_default_route_bfd' and 'enable_default_route_ecmp' extra attributes was added in neutron-lib change I2618475636b2bb9bfd743a62f5d4859d4f68a547. During review it was requested to make the default for these values configurable. This is not possible with the apidef currently committed to neutron-lib. In the interest of time before feature freze, patch the apidef in Neutron to allow for determining the default value at runtime. As soon as an updated neutron-lib is available we can drop this commit. Change-Id: I2ab6b275a4867e488462c390fa16420ce8552850 --- neutron/extensions/l3_enable_default_route_bfd.py | 8 ++++++++ neutron/extensions/l3_enable_default_route_ecmp.py | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/neutron/extensions/l3_enable_default_route_bfd.py b/neutron/extensions/l3_enable_default_route_bfd.py index eb0190bbc2a..eed33d8d9b1 100644 --- a/neutron/extensions/l3_enable_default_route_bfd.py +++ b/neutron/extensions/l3_enable_default_route_bfd.py @@ -20,3 +20,11 @@ from neutron_lib.api import extensions class L3_enable_default_route_bfd(extensions.APIExtensionDescriptor): api_definition = apidef + + def __init__(self): + # NOTE(fnordahl): Temporary fix awaiting permanent fix in neutron-lib, + # drop when change I9096685fb79a84e11a8547a5aaa16f7f2df48a56 is merged. + apidef.RESOURCE_ATTRIBUTE_MAP[ + apidef.COLLECTION_NAME][apidef.ENABLE_DEFAULT_ROUTE_BFD].update( + {'default': None}) + super().__init__() diff --git a/neutron/extensions/l3_enable_default_route_ecmp.py b/neutron/extensions/l3_enable_default_route_ecmp.py index 27affc7a76f..048ea637ddd 100644 --- a/neutron/extensions/l3_enable_default_route_ecmp.py +++ b/neutron/extensions/l3_enable_default_route_ecmp.py @@ -20,3 +20,11 @@ from neutron_lib.api import extensions class L3_enable_default_route_ecmp(extensions.APIExtensionDescriptor): api_definition = apidef + + def __init__(self): + # NOTE(fnordahl): Temporary fix awaiting permanent fix in neutron-lib, + # drop when change I9096685fb79a84e11a8547a5aaa16f7f2df48a56 is merged. + apidef.RESOURCE_ATTRIBUTE_MAP[ + apidef.COLLECTION_NAME][apidef.ENABLE_DEFAULT_ROUTE_ECMP].update( + {'default': None}) + super().__init__()