mirror of https://github.com/jumpserver/jumpserver
fix: 修复es类型的命令存储更新忽略证书字段不成功的问题
parent
379c7198da
commit
d1420de4c2
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue