From 87393f4eba3b68f9598c02dcbe1f06f2afdd400c Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Thu, 30 Mar 2017 14:01:30 +0800 Subject: replace self-defined http codes with standard definitions Change-Id: I3045dc690e0bc1186f5c548cb533462dd03130d9 Signed-off-by: SerenaFeng --- testapi/opnfv_testapi/resources/testcase_handlers.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'testapi/opnfv_testapi/resources/testcase_handlers.py') diff --git a/testapi/opnfv_testapi/resources/testcase_handlers.py b/testapi/opnfv_testapi/resources/testcase_handlers.py index 3debd69..1211a05 100644 --- a/testapi/opnfv_testapi/resources/testcase_handlers.py +++ b/testapi/opnfv_testapi/resources/testcase_handlers.py @@ -6,7 +6,8 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -from opnfv_testapi.common import constants +import httplib + from opnfv_testapi.resources import handlers from opnfv_testapi.resources import testcase_models from opnfv_testapi.tornado_swagger import swagger @@ -58,12 +59,12 @@ class TestcaseCLHandler(GenericTestcaseHandler): def p_error(data): message = 'Could not find project [{}]'.format(data.project_name) - return constants.HTTP_FORBIDDEN, message + return httplib.FORBIDDEN, message def tc_error(data): message = '{} already exists as a testcase in project {}'\ .format(data.name, data.project_name) - return constants.HTTP_FORBIDDEN, message + return httplib.FORBIDDEN, message miss_checks = ['name'] db_checks = [(self.db_projects, True, p_query, p_error), -- cgit 1.2.3-korg