From cdf8398169f455b840a7fb89ba55fd0f58d763f0 Mon Sep 17 00:00:00 2001 From: BaiJiangJie Date: Wed, 24 Oct 2018 10:29:40 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E4=BF=AE=E5=A4=8D=E5=88=9B=E5=BB=BA?= =?UTF-8?q?es=E5=91=BD=E4=BB=A4=E5=AD=98=E5=82=A8=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E6=9C=89=E6=95=88=E6=80=A7=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/api.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/common/api.py b/apps/common/api.py index f65efa8ca..064c1a6b9 100644 --- a/apps/common/api.py +++ b/apps/common/api.py @@ -144,7 +144,11 @@ class CommandStorageCreateAPI(APIView): def is_valid(storage_data): if storage_data.get('TYPE') == 'server': return True - storage = jms_storage.get_log_storage(storage_data) + try: + storage = jms_storage.get_log_storage(storage_data) + except Exception: + return False + return storage.ping()