summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/resources/scenario_handlers.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2017-03-30 14:01:30 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2017-03-30 14:01:30 +0800
commit87393f4eba3b68f9598c02dcbe1f06f2afdd400c (patch)
treed38571be07983f75fe36d8b92ca84c470b65a176 /testapi/opnfv_testapi/resources/scenario_handlers.py
parentbc563719888542de948e3145b22d944dc38f783c (diff)
replace self-defined http codes with standard definitions
Change-Id: I3045dc690e0bc1186f5c548cb533462dd03130d9 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'testapi/opnfv_testapi/resources/scenario_handlers.py')
-rw-r--r--testapi/opnfv_testapi/resources/scenario_handlers.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/testapi/opnfv_testapi/resources/scenario_handlers.py b/testapi/opnfv_testapi/resources/scenario_handlers.py
index 80eb1aa..a2856db 100644
--- a/testapi/opnfv_testapi/resources/scenario_handlers.py
+++ b/testapi/opnfv_testapi/resources/scenario_handlers.py
@@ -1,8 +1,8 @@
import functools
+import httplib
from tornado import web
-from opnfv_testapi.common import constants
from opnfv_testapi.resources import handlers
import opnfv_testapi.resources.scenario_models as models
from opnfv_testapi.tornado_swagger import swagger
@@ -84,7 +84,7 @@ class ScenariosCLHandler(GenericScenarioHandler):
def error(data):
message = '{} already exists as a scenario'.format(data.name)
- return constants.HTTP_FORBIDDEN, message
+ return httplib.FORBIDDEN, message
miss_checks = ['name']
db_checks = [(self.table, False, query, error)]
@@ -185,7 +185,7 @@ class ScenarioGURHandler(GenericScenarioHandler):
def _update_requests_rename(self, data):
data.name = self._term.get('name')
if not data.name:
- raise web.HTTPError(constants.HTTP_BAD_REQUEST,
+ raise web.HTTPError(httplib.BAD_REQUEST,
"new scenario name is not provided")
def _update_requests_add_installer(self, data):