aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docker/Dockerfile2
-rw-r--r--functest/api/resources/v1/envs.py9
2 files changed, 7 insertions, 4 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 51d28b90..abb9b0d7 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -110,3 +110,5 @@ RUN sh -c 'curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -' \
&& cd /src/promise/source && npm install
RUN echo ". ${FUNCTEST_DIR}/cli/functest-complete.sh" >> /root/.bashrc
+
+CMD ["functest_restapi"]
diff --git a/functest/api/resources/v1/envs.py b/functest/api/resources/v1/envs.py
index fb76fa63..8020544f 100644
--- a/functest/api/resources/v1/envs.py
+++ b/functest/api/resources/v1/envs.py
@@ -33,10 +33,11 @@ class V1Envs(ApiResource):
def prepare(self, args): # pylint: disable=no-self-use, unused-argument
""" Prepare environment """
- try:
- ft_utils.execute_command("prepare_env start")
- except Exception as err: # pylint: disable=broad-except
- return api_utils.result_handler(status=1, data=str(err))
+
+ result_env = ft_utils.execute_command("prepare_env start")
+ if not result_env == 0:
+ return api_utils.result_handler(
+ status=1, data="Failed to prepare env")
return api_utils.result_handler(
status=0, data="Prepare env successfully")