Fix validation of direction on TapFlow
This patch fixes the validation of direction. * change API validator from type:string to type:values * remove None from direction_enum because of NOT NULL constraint Change-Id: Iae4f13451002db7567425ae33d1c36bd2013ae75 Closes-Bug: #1585445
This commit is contained in:
parent
75b40370cf
commit
0f0e3ceead
@ -71,11 +71,11 @@ TapFlow Represents the port from which the traffic needs to be mirrored.
|
||||
'validate': {'type:uuid': None},
|
||||
'required_by_policy': True, 'is_visible': True},
|
||||
'direction': {'allow_post': True, 'allow_put': False,
|
||||
'validate': {'type:string': direction_enum},
|
||||
'validate': {'type:values': direction_enum},
|
||||
'is_visible': True}
|
||||
}
|
||||
|
||||
direction_enum = [None, 'IN', 'OUT', 'BOTH']
|
||||
direction_enum = ['IN', 'OUT', 'BOTH']
|
||||
|
||||
|
||||
Multiple TapFlow instances can be associated with a single TapService
|
||||
|
@ -61,7 +61,7 @@ class TapServiceLimitReached(qexception.OverQuota):
|
||||
message = _("Reached the maximum quota for Tap Services")
|
||||
|
||||
|
||||
direction_enum = [None, 'IN', 'OUT', 'BOTH']
|
||||
direction_enum = ['IN', 'OUT', 'BOTH']
|
||||
|
||||
|
||||
'''
|
||||
@ -117,7 +117,7 @@ RESOURCE_ATTRIBUTE_MAP = {
|
||||
'validate': {'type:uuid': None},
|
||||
'required_by_policy': True, 'is_visible': True},
|
||||
'direction': {'allow_post': True, 'allow_put': False,
|
||||
'validate': {'type:string': direction_enum},
|
||||
'validate': {'type:values': direction_enum},
|
||||
'is_visible': True}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user