diff options
author | Serena Feng <feng.xiaowei@zte.com.cn> | 2017-03-31 01:42:44 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-03-31 01:42:44 +0000 |
commit | 8eb68cff96445dc53ee1c232b565aa4a61d0a526 (patch) | |
tree | 18706484d2ae582399724306ce65f5594b7363f7 /utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py | |
parent | 85eba2eafa62f00eb3c28bb9968e89bcaba5e73e (diff) | |
parent | b9e0948256af817e63f901ec5277d3ef9fe36fdd (diff) |
Merge "unify raise exception process"
Diffstat (limited to 'utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py')
-rw-r--r-- | utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py b/utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py index a2856dbd7..9d0233c77 100644 --- a/utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py +++ b/utils/test/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)) |