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:
Yoichiro Iura 2016-05-25 05:59:31 +00:00
parent 75b40370cf
commit 0f0e3ceead
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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}
}
}