diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-04-05 16:23:03 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-04-06 16:55:21 +0800 |
commit | 0620b2cbb21714c1a5e485186c46c2c24485ef37 (patch) | |
tree | 48fae29c4a2827d51ce6bc418910194b54d35f5c /testapi/opnfv_testapi/resources/project_handlers.py | |
parent | dbdb452b2761a630ec8574b22553ac5531611201 (diff) |
unify error message in TestAPI
Change-Id: I994feb7bf340c9e48bebe9fdf3dc3a76bc254652
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'testapi/opnfv_testapi/resources/project_handlers.py')
-rw-r--r-- | testapi/opnfv_testapi/resources/project_handlers.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/testapi/opnfv_testapi/resources/project_handlers.py b/testapi/opnfv_testapi/resources/project_handlers.py index 087bb8a..59e0b88 100644 --- a/testapi/opnfv_testapi/resources/project_handlers.py +++ b/testapi/opnfv_testapi/resources/project_handlers.py @@ -9,6 +9,7 @@ import httplib import handlers +from opnfv_testapi.common import message from opnfv_testapi.tornado_swagger import swagger import project_models @@ -48,8 +49,7 @@ class ProjectCLHandler(GenericProjectHandler): return {'name': data.name} def error(data): - message = '{} already exists as a project'.format(data.name) - return httplib.FORBIDDEN, message + return httplib.FORBIDDEN, message.exist('project', data.name) miss_checks = ['name'] db_checks = [(self.table, False, query, error)] |