From d1420de4c2d2d65f0f9713a08c573834c21c9fed Mon Sep 17 00:00:00 2001 From: "Jiangjie.Bai" Date: Mon, 20 Jun 2022 14:37:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Des=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E7=9A=84=E5=91=BD=E4=BB=A4=E5=AD=98=E5=82=A8=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=BF=BD=E7=95=A5=E8=AF=81=E4=B9=A6=E5=AD=97=E6=AE=B5=E4=B8=8D?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/terminal/models/storage.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/terminal/models/storage.py b/apps/terminal/models/storage.py index 857d3c77d..4ddab1bcc 100644 --- a/apps/terminal/models/storage.py +++ b/apps/terminal/models/storage.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals +import copy import os from importlib import import_module @@ -77,14 +78,14 @@ class CommandStorage(CommonStorageModelMixin, CommonModelMixin): def config(self): config = self.meta config.update({'TYPE': self.type}) - return config + return copy.deepcopy(config) @property def valid_config(self): config = self.config if self.type_es and config.get('INDEX_BY_DATE'): engine_mod = import_module(TYPE_ENGINE_MAPPING[self.type]) - store = engine_mod.CommandStore(dict(**config)) + store = engine_mod.CommandStore(config) store._ensure_index_exists() index_prefix = config.get('INDEX') or 'jumpserver' date = local_now_date_display()