diff options
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, 3 insertions, 3 deletions
diff --git a/utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py b/utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py index 9d0233c77..bad79fdc6 100644 --- a/utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py +++ b/utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py @@ -1,6 +1,7 @@ import functools import httplib +from opnfv_testapi.common import message from opnfv_testapi.common import raises from opnfv_testapi.resources import handlers import opnfv_testapi.resources.scenario_models as models @@ -82,8 +83,7 @@ class ScenariosCLHandler(GenericScenarioHandler): return {'name': data.name} def error(data): - message = '{} already exists as a scenario'.format(data.name) - return httplib.FORBIDDEN, message + return httplib.FORBIDDEN, message.exist('scenario', data.name) miss_checks = ['name'] db_checks = [(self.table, False, query, error)] @@ -184,7 +184,7 @@ class ScenarioGURHandler(GenericScenarioHandler): def _update_requests_rename(self, data): data.name = self._term.get('name') if not data.name: - raises.BadRequest("new scenario name is not provided") + raises.BadRequest(message.missing('name')) def _update_requests_add_installer(self, data): data.installers.append(models.ScenarioInstaller.from_dict(self._term)) |