From 11235bb07c22a4ea1731e1812306718ba2182d0a Mon Sep 17 00:00:00 2001 From: vapao Date: Fri, 3 Apr 2020 12:50:55 +0800 Subject: [PATCH] =?UTF-8?q?F=20=E4=BF=AE=E5=A4=8D=E6=9F=90=E4=BA=9B?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=9C=AA=E8=83=BD=E6=AD=A3=E5=B8=B8=E5=8F=8D?= =?UTF-8?q?=E9=A6=88=E5=88=B0=E5=8F=91=E5=B8=83=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_api/apps/deploy/utils.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/spug_api/apps/deploy/utils.py b/spug_api/apps/deploy/utils.py index 935f6f8..ffb82e5 100644 --- a/spug_api/apps/deploy/utils.py +++ b/spug_api/apps/deploy/utils.py @@ -91,8 +91,10 @@ def _ext1_deploy(req, helper, env): for h_id in json.loads(req.host_ids): threads.append(executor.submit(_deploy_ext1_host, helper, h_id, extend, env)) for t in futures.as_completed(threads): - if t.exception(): - raise t.exception() + exception = t.exception() + if exception: + helper.send_error(h_id, f'Exception: {exception}') + raise exception def _ext2_deploy(req, helper, env): @@ -114,8 +116,10 @@ def _ext2_deploy(req, helper, env): for h_id in json.loads(req.host_ids): threads.append(executor.submit(_deploy_ext2_host, helper, h_id, host_actions, env)) for t in futures.as_completed(threads): - if t.exception(): - raise t.exception() + exception = t.exception() + if exception: + helper.send_error(h_id, f'Exception: {exception}') + raise exception def _deploy_ext1_host(helper, h_id, extend, env):