summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthuva4 <tharma.thuva@gmail.com>2018-04-12 10:26:06 +0530
committerthuva4 <tharma.thuva@gmail.com>2018-04-12 10:26:06 +0530
commitf23e8d9b31b53869e4baa36cae61af5853b49fb2 (patch)
treec3f4f1ef0a09fbc6eead626c9a6c70f2f3eb7659
parentc77cf76cbf31e65aa599f71f33d59abc267b4e50 (diff)
Allow update the other field(exclude name)
JIRA: RELENG-350 Change-Id: I1713985c02f59ea518058c309043f66a6bd07855 Signed-off-by: thuva4 <tharma.thuva@gmail.com>
-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)