diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-03-30 15:33:19 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-03-30 15:36:50 +0800 |
commit | 7c0915d9e6a9c81b4df6cd0ddda21287137e0088 (patch) | |
tree | adef655d47005e278a55682ccc98eaf2c1c15a2b /testapi/opnfv_testapi/resources/scenario_handlers.py | |
parent | 87393f4eba3b68f9598c02dcbe1f06f2afdd400c (diff) |
unify raise exception process
Change-Id: I109ef9550a57e218b6f5c9196812b33133d34134
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.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/testapi/opnfv_testapi/resources/scenario_handlers.py b/testapi/opnfv_testapi/resources/scenario_handlers.py index a2856db..9d0233c 100644 --- a/testapi/opnfv_testapi/resources/scenario_handlers.py +++ b/testapi/opnfv_testapi/resources/scenario_handlers.py @@ -1,8 +1,7 @@ import functools import httplib -from tornado import web - +from opnfv_testapi.common import raises from opnfv_testapi.resources import handlers import opnfv_testapi.resources.scenario_models as models from opnfv_testapi.tornado_swagger import swagger @@ -185,8 +184,7 @@ class ScenarioGURHandler(GenericScenarioHandler): def _update_requests_rename(self, data): data.name = self._term.get('name') if not data.name: - raise web.HTTPError(httplib.BAD_REQUEST, - "new scenario name is not provided") + raises.BadRequest("new scenario name is not provided") def _update_requests_add_installer(self, data): data.installers.append(models.ScenarioInstaller.from_dict(self._term)) |