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
This commit is contained in:
Frode Nordahl 2023-08-29 11:30:04 +02:00
parent 113f3f6689
commit 25728955c9
2 changed files with 16 additions and 0 deletions

View File

@ -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__()

View File

@ -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__()