summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerena Feng <feng.xiaowei@zte.com.cn>2018-04-13 06:43:53 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-04-13 06:43:53 +0000
commit7869e7436fe5356125c58abdddf247ae2a3f072c (patch)
tree287b6ce222f1dc43d57f5b7bbaec2bece698346d
parent1851b6f0a33d1805029abc9d31ad33fd5e018b56 (diff)
parentf23e8d9b31b53869e4baa36cae61af5853b49fb2 (diff)
Merge "Allow update the other field(exclude name)"
-rw-r--r--testapi/opnfv_testapi/common/check.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/testapi/opnfv_testapi/common/check.py b/testapi/opnfv_testapi/common/check.py
index 09a9270..fdc527f 100644
--- a/testapi/opnfv_testapi/common/check.py
+++ b/testapi/opnfv_testapi/common/check.py
@@ -65,12 +65,14 @@ def is_reource_tied(method):
}
if self.table in tied_maps:
if method.__name__ == '_update':
- if 'name' not in self.json_args:
- ret = yield gen.coroutine(method)(self, *args, **kwargs)
- raise gen.Return(ret)
+ if 'name' in self.json_args:
+ if self.json_args['name'] == kwargs.get('query')['name']:
+ ret = yield gen.coroutine(method)(
+ self, *args, **kwargs)
+ raise gen.Return(ret)
query_data[tied_maps[self.table][1]] = kwargs.get('query')['name']
- data = yield dbapi.db_find_one(tied_maps[self.table][0],
- query_data)
+ data = yield dbapi.db_find_one(
+ tied_maps[self.table][0], query_data)
if data:
raises.Unauthorized(message.tied_with_resource())
ret = yield gen.coroutine(method)(self, *args, **kwargs)