summaryrefslogtreecommitdiffstats
path: root/utils/test/testapi/opnfv_testapi/resources
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2017-03-29 16:36:56 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-03-29 16:36:56 +0000
commit8bf12376cc1ba62a4d26967d074a6de12996d644 (patch)
tree414b36a33c7bf3666e5185a3e347ff96cd639fd8 /utils/test/testapi/opnfv_testapi/resources
parent262851ad3381b3206b73206f3b3bc080488c3588 (diff)
parentbd859d5cc368f630e899654cdbc8b11d978c0d07 (diff)
Merge "add rename scenario exceptions"
Diffstat (limited to 'utils/test/testapi/opnfv_testapi/resources')
-rw-r--r--utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py b/utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py
index 4c31a6f0f..80eb1aabe 100644
--- a/utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py
+++ b/utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py
@@ -1,5 +1,7 @@
import functools
+from tornado import web
+
from opnfv_testapi.common import constants
from opnfv_testapi.resources import handlers
import opnfv_testapi.resources.scenario_models as models
@@ -182,6 +184,9 @@ 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,
+ "new scenario name is not provided")
def _update_requests_add_installer(self, data):
data.installers.append(models.ScenarioInstaller.from_dict(self._term))