summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/resources/models.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2017-08-23 14:04:59 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2017-08-25 13:54:16 +0800
commit3fbd55c9b9550c0248827eb705d60ec2ce4cc658 (patch)
treead23ede8955e4ac439ae34e57f8f5ecde871e8fa /testapi/opnfv_testapi/resources/models.py
parent2eb503cb2e3496131c21954506da58b056c8fb46 (diff)
update versions under scenario
1. post, add one or more new versions 2. update, replace existed version as a totality 3. delete, delete one or more versions by name 4. in post&update, if schema is not consistent with ScenarioVersion model, BadRequest will be raised(only extra keys will be detected currently) 5. in post, if project already exist, return Conflict with already exist message 6. in update, if a version appears more than once, also return Conflict with already exist message 7. add update with conflict unittest for projects Change-Id: I0d2c8a5567f3abce7b0313a64e18303af02cc002 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'testapi/opnfv_testapi/resources/models.py')
-rw-r--r--testapi/opnfv_testapi/resources/models.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/testapi/opnfv_testapi/resources/models.py b/testapi/opnfv_testapi/resources/models.py
index 6f04cc2..e70a6ed 100644
--- a/testapi/opnfv_testapi/resources/models.py
+++ b/testapi/opnfv_testapi/resources/models.py
@@ -61,11 +61,11 @@ class ModelBase(object):
'{} has no attribute {}'.format(cls.__name__, k))
value = v
if isinstance(v, dict) and k in attr_parser:
- value = attr_parser[k].from_dict(v)
+ value = attr_parser[k].from_dict_with_raise(v)
elif isinstance(v, list) and k in attr_parser:
value = []
for item in v:
- value.append(attr_parser[k].from_dict(item))
+ value.append(attr_parser[k].from_dict_with_raise(item))
t.__setattr__(k, value)