|
|
|
@ -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()
|
|
|
|
|