diff options
author | thuva4 <tharma.thuva@gmail.com> | 2017-11-30 14:44:45 +0530 |
---|---|---|
committer | thuva4 <tharma.thuva@gmail.com> | 2017-12-02 09:08:09 +0530 |
commit | ae88dfd997ae0516ec097033c378740ea8580483 (patch) | |
tree | f04e1356afa0126ab1064b34bff3c11504b89022 /testapi/opnfv_testapi/common | |
parent | 3e69f8623c87f0d1d673d702d3516e688daf9a0d (diff) |
redesign the pods interface
redesign the pods interface and add the delate operation
for the podas in backend.
Fix the issue in creating pods: Owner is null
Change-Id: I2f8e907f9ab62362a3003d6457662ab85bf2cb12
Signed-off-by: thuva4 <tharma.thuva@gmail.com>
Diffstat (limited to 'testapi/opnfv_testapi/common')
-rw-r--r-- | testapi/opnfv_testapi/common/check.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/testapi/opnfv_testapi/common/check.py b/testapi/opnfv_testapi/common/check.py index 1155d24..db28e44 100644 --- a/testapi/opnfv_testapi/common/check.py +++ b/testapi/opnfv_testapi/common/check.py @@ -28,7 +28,7 @@ def is_authorized(method): user_info = yield dbapi.db_find_one('users', {'user': testapi_id}) if not user_info: raises.Unauthorized(message.not_lfid()) - if "owner" in kwargs: + if method.__name__ == "_create": kwargs['owner'] = testapi_id if self.table in ['projects']: query = kwargs.get('query') @@ -137,9 +137,9 @@ def new_not_exists(xstep): query_data = query() if self.table == 'pods': if query_data.get('name') is not None: - query_data['name'] = re.compile(query_data.get('name'), - re.IGNORECASE) + query_data['name'] = re.compile('\\b' + query_data.get('name') + '\\b', re.IGNORECASE) to_data = yield dbapi.db_find_one(self.table, query_data) + print to_data if to_data: raises.Forbidden(message.exist(self.table, query())) ret = yield gen.coroutine(xstep)(self, *args, **kwargs) |