fix: 修复es类型的命令存储更新忽略证书字段不成功的问题

pull/8447/head
Jiangjie.Bai 2 years ago committed by 老广
parent 379c7198da
commit d1420de4c2

@ -1,5 +1,6 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import copy
import os import os
from importlib import import_module from importlib import import_module
@ -77,14 +78,14 @@ class CommandStorage(CommonStorageModelMixin, CommonModelMixin):
def config(self): def config(self):
config = self.meta config = self.meta
config.update({'TYPE': self.type}) config.update({'TYPE': self.type})
return config return copy.deepcopy(config)
@property @property
def valid_config(self): def valid_config(self):
config = self.config config = self.config
if self.type_es and config.get('INDEX_BY_DATE'): if self.type_es and config.get('INDEX_BY_DATE'):
engine_mod = import_module(TYPE_ENGINE_MAPPING[self.type]) engine_mod = import_module(TYPE_ENGINE_MAPPING[self.type])
store = engine_mod.CommandStore(dict(**config)) store = engine_mod.CommandStore(config)
store._ensure_index_exists() store._ensure_index_exists()
index_prefix = config.get('INDEX') or 'jumpserver' index_prefix = config.get('INDEX') or 'jumpserver'
date = local_now_date_display() date = local_now_date_display()

Loading…
Cancel
Save