summaryrefslogtreecommitdiffstats
path: root/api/base.py
diff options
context:
space:
mode:
authorJing Lu <lvjing5@huawei.com>2017-06-30 06:49:43 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-06-30 06:49:43 +0000
commit14bc98f0e810e37f4600cb0b16d227e8290e1db2 (patch)
treeb7ef7b0d60c018620875b185fe7b66dbd2a12ef5 /api/base.py
parentbf298f7dfa5de497ef3cd69aaea7218ed7559160 (diff)
parent1b9eeb504ed9416c74e1caf8975b51ee6af86b29 (diff)
Merge "Change prepareYardstickEnv to prepare_env and add log info"
Diffstat (limited to 'api/base.py')
-rw-r--r--api/base.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/api/base.py b/api/base.py
index 6a4ba12c3..0f1e76a57 100644
--- a/api/base.py
+++ b/api/base.py
@@ -15,6 +15,7 @@ from flask import request
from flask_restful import Resource
from api.utils import common as common_utils
+from yardstick.common import constants as consts
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
@@ -60,5 +61,5 @@ class ApiResource(Resource):
resources = importlib.import_module(module_name)
try:
return getattr(resources, action)(args)
- except NameError:
- common_utils.error_handler('Wrong action')
+ except AttributeError:
+ common_utils.result_handler(consts.API_ERROR, 'No such action')