Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
coco
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
coco
Commits
6cdf0c1d
Commit
6cdf0c1d
authored
Jan 22, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into test
parents
37c0380b
3c7b0d56
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
4 deletions
+12
-4
app.py
coco/app.py
+5
-1
interactive.py
coco/interactive.py
+1
-1
recorder.py
coco/recorder.py
+2
-1
conf_example.py
conf_example.py
+4
-1
No files found.
coco/app.py
View file @
6cdf0c1d
...
...
@@ -8,6 +8,7 @@ import time
import
threading
import
logging
import
socket
import
json
from
jms.service
import
AppService
...
...
@@ -19,7 +20,7 @@ from .tasks import TaskHandler
from
.recorder
import
get_command_recorder_class
,
get_replay_recorder_class
__version__
=
'0.
4
.0'
__version__
=
'0.
5
.0'
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
__file__
))
logger
=
logging
.
getLogger
(
__file__
)
...
...
@@ -95,6 +96,9 @@ class Coco:
def
load_extra_conf_from_server
(
self
):
configs
=
self
.
service
.
load_config_from_server
()
logger
.
debug
(
"Loading config from server: {}"
.
format
(
json
.
dumps
(
configs
)
))
self
.
config
.
update
(
configs
)
def
get_recorder_class
(
self
):
...
...
coco/interactive.py
View file @
6cdf0c1d
...
...
@@ -42,7 +42,7 @@ class InteractiveServer:
if
self
.
_search_result
:
return
self
.
_search_result
else
:
return
None
return
[]
@search_result.setter
def
search_result
(
self
,
value
):
...
...
coco/recorder.py
View file @
6cdf0c1d
...
...
@@ -189,6 +189,7 @@ class ESCommandRecorder(CommandRecorder, metaclass=Singleton):
batch_size
=
10
timeout
=
5
no
=
0
default_hosts
=
[
"http://localhost"
]
def
__init__
(
self
,
app
):
super
()
.
__init__
(
app
)
...
...
@@ -196,7 +197,7 @@ class ESCommandRecorder(CommandRecorder, metaclass=Singleton):
self
.
stop_evt
=
threading
.
Event
()
self
.
push_to_es_async
()
self
.
__class__
.
no
+=
1
self
.
store
=
ESStore
(
**
app
.
config
[
"COMMAND_RECORD_OPTIONS"
]
)
self
.
store
=
ESStore
(
app
.
config
[
"COMMAND_STORAGE"
]
.
get
(
"HOSTS"
,
self
.
default_hosts
)
)
if
not
self
.
store
.
ping
():
raise
AssertionError
(
"ESCommand storage init error"
)
...
...
conf_example.py
View file @
6cdf0c1d
...
...
@@ -9,7 +9,7 @@ BASE_DIR = os.path.dirname(__file__)
class
Config
:
"""
Coco config file
Coco config file
, coco also load config from server update setting below
"""
# 项目名称, 会用来向Jumpserver注册, 识别而已, 不能重复
# APP_NAME = "localhost"
...
...
@@ -59,6 +59,9 @@ class Config:
# Admin的名字,出问题会提示给用户
# ADMINS = ''
COMMAND_STORAGE
=
{
"TYPE"
:
"server"
}
config
=
Config
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment