Add error informations for users when value is invalid in database

User can set bandwidth max-kbps or max-burst-kbps in QOS and
the value may be bigger than definiton in database. We need give
error information for users but throw exception in neutron server

Change-Id: Id18fbd2331a470dd175648e27890d766ead26871
Closes-Bug:1600708
This commit is contained in:
QunyingRan 2016-08-03 05:56:50 -04:00
parent 85260a882c
commit 58316f7a8c
1 changed files with 4 additions and 2 deletions

6
neutron/extensions/qos.py Normal file → Executable file
View File

@ -77,11 +77,13 @@ SUB_RESOURCE_ATTRIBUTE_MAP = {
**{'max_kbps': {
'allow_post': True, 'allow_put': True,
'is_visible': True, 'default': None,
'validate': {'type:non_negative': None}},
'validate': {'type:range': [0,
common_constants.DB_INTEGER_MAX_VALUE]}},
'max_burst_kbps': {
'allow_post': True, 'allow_put': True,
'is_visible': True, 'default': 0,
'validate': {'type:non_negative': None}}})
'validate': {'type:range': [0,
common_constants.DB_INTEGER_MAX_VALUE]}}})
},
'dscp_marking_rules': {
'parent': {'collection_name': 'policies',