From 2e959fd7f1f6becab862113acdb0cd9d60b53552 Mon Sep 17 00:00:00 2001 From: elajkat Date: Mon, 17 Feb 2025 11:36:33 +0100 Subject: [PATCH] taas: Split direction enum The direction enum for taas (IN, OUT, BOTH) used in many places in tap-as-a-service, split it to make it easier Change-Id: I0f99d0306c580ef77c59d2d27249190883f93bff --- neutron_lib/api/definitions/taas.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/neutron_lib/api/definitions/taas.py b/neutron_lib/api/definitions/taas.py index dbba6276f..627e85b3f 100644 --- a/neutron_lib/api/definitions/taas.py +++ b/neutron_lib/api/definitions/taas.py @@ -14,7 +14,12 @@ # under the License. -direction_enum = ['IN', 'OUT', 'BOTH'] +DIRECTION_IN = 'IN' +DIRECTION_OUT = 'OUT' +DIRECTION_BOTH = 'BOTH' +DIRECTION_ENUM = [DIRECTION_IN, DIRECTION_OUT, DIRECTION_BOTH] +DIRECTION_IN_BOTH = [DIRECTION_IN, DIRECTION_BOTH] +DIRECTION_OUT_BOTH = [DIRECTION_OUT, DIRECTION_BOTH] ''' Resource Attribute Map: @@ -76,7 +81,7 @@ RESOURCE_ATTRIBUTE_MAP = { 'validate': {'type:uuid': None}, 'required_by_policy': True, 'is_visible': True}, 'direction': {'allow_post': True, 'allow_put': False, - 'validate': {'type:values': direction_enum}, + 'validate': {'type:values': DIRECTION_ENUM}, 'is_visible': True}, 'status': {'allow_post': False, 'allow_put': False, 'is_visible': True}