diff options
author | valentin boucher <valentin.boucher@orange.com> | 2017-09-05 07:43:26 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-09-05 07:43:26 +0000 |
commit | ffa9b999bb57208bd744b65d62570313f1b2b9d1 (patch) | |
tree | b7b6640bf84ac2a5f7c7f14d794908fea39bb20a /functest/api/resources/v1/envs.py | |
parent | 96357c54369a04f2b5d117573cf3fd3478d63623 (diff) | |
parent | 842261043f74b35c61889ee886e480dd280a5c0d (diff) |
Merge "Launch Functest RestApi once the container is run"
Diffstat (limited to 'functest/api/resources/v1/envs.py')
-rw-r--r-- | functest/api/resources/v1/envs.py | 9 |
1 files changed, 5 insertions, 4 deletions
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") |