summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/resources/scenario_handlers.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2017-03-29 17:02:43 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2017-03-29 17:30:09 +0800
commitbf827582c6403a67d742ccdb23c04db89d9f8246 (patch)
tree8b550f9e9a00bc983266c64563f43688c527fb30 /testapi/opnfv_testapi/resources/scenario_handlers.py
parent2e08872902f752addff5c6755d698b4fbb022a7c (diff)
add rename scenario exceptions
JIRA: RELENG-163 Change-Id: I680a181a3c1728034e5782de4bc65cc07f64540c 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.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/testapi/opnfv_testapi/resources/scenario_handlers.py b/testapi/opnfv_testapi/resources/scenario_handlers.py
index 4c31a6f..80eb1aa 100644
--- a/testapi/opnfv_testapi/resources/scenario_handlers.py
+++ b/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))