Commit 9107015c authored by ibuler's avatar ibuler

[Update] 修改依赖和配置文件

parent 491ef181
...@@ -52,10 +52,9 @@ class Coco: ...@@ -52,10 +52,9 @@ class Coco:
'REPLAY_RECORD_ENGINE': 'server', 'REPLAY_RECORD_ENGINE': 'server',
} }
def __init__(self, name=None, root_path=None): def __init__(self, root_path=None):
self.root_path = root_path if root_path else BASE_DIR self.root_path = root_path if root_path else BASE_DIR
self.config = self.config_class(self.root_path, defaults=self.default_config) self.config = self.config_class(self.root_path, defaults=self.default_config)
self.name = name if name else self.config["NAME"]
self.sessions = [] self.sessions = []
self.clients = [] self.clients = []
self.lock = threading.Lock() self.lock = threading.Lock()
...@@ -67,6 +66,10 @@ class Coco: ...@@ -67,6 +66,10 @@ class Coco:
self.command_recorder_class = None self.command_recorder_class = None
self._task_handler = None self._task_handler = None
@property
def name(self):
return self.config["NAME"]
@property @property
def service(self): def service(self):
if self._service is None: if self._service is None:
......
...@@ -48,6 +48,7 @@ def create_logger(app): ...@@ -48,6 +48,7 @@ def create_logger(app):
loggers={ loggers={
'coco': main_setting, 'coco': main_setting,
'paramiko': main_setting, 'paramiko': main_setting,
'jms': main_setting,
} }
) )
......
...@@ -12,7 +12,7 @@ class Config: ...@@ -12,7 +12,7 @@ class Config:
Coco config file, coco also load config from server update setting below Coco config file, coco also load config from server update setting below
""" """
# 项目名称, 会用来向Jumpserver注册, 识别而已, 不能重复 # 项目名称, 会用来向Jumpserver注册, 识别而已, 不能重复
# APP_NAME = "localhost" # NAME = "localhost"
# Jumpserver项目的url, api请求注册会使用 # Jumpserver项目的url, api请求注册会使用
# CORE_HOST = os.environ.get("CORE_HOST") or 'http://127.0.0.1:8080' # CORE_HOST = os.environ.get("CORE_HOST") or 'http://127.0.0.1:8080'
......
...@@ -28,5 +28,5 @@ tornado==4.5.2 ...@@ -28,5 +28,5 @@ tornado==4.5.2
urllib3==1.22 urllib3==1.22
wcwidth==0.1.7 wcwidth==0.1.7
werkzeug==0.12.2 werkzeug==0.12.2
jumpserver-python-sdk==0.0.25 jumpserver-python-sdk==0.0.26
jms-es-sdk jms-es-sdk
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment