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
d0238e3f
Commit
d0238e3f
authored
Feb 18, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改配置文件判断
parent
35b5361b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
app.py
coco/app.py
+7
-5
conf.py
coco/conf.py
+4
-0
No files found.
coco/app.py
View file @
d0238e3f
...
...
@@ -38,6 +38,7 @@ class Coco:
self
.
replay_recorder_class
=
None
self
.
command_recorder_class
=
None
self
.
_task_handler
=
None
self
.
first_load_extra_conf
=
True
@property
def
sshd
(
self
):
...
...
@@ -57,17 +58,18 @@ class Coco:
self
.
_task_handler
=
TaskHandler
()
return
self
.
_task_handler
@staticmethod
@ignore_error
def
load_extra_conf_from_server
():
def
load_extra_conf_from_server
(
self
):
configs
=
app_service
.
load_config_from_server
()
config
.
update
(
configs
)
tmp
=
copy
.
deepcopy
(
configs
)
tmp
[
'HOST_KEY'
]
=
tmp
.
get
(
'HOST_KEY'
,
''
)[
32
:
50
]
+
'...'
logger
.
debug
(
"Loading config from server: {}"
.
format
(
json
.
dumps
(
tmp
)
))
if
self
.
first_load_extra_conf
:
logger
.
debug
(
"Loading config from server: {}"
.
format
(
json
.
dumps
(
tmp
)
))
self
.
first_load_extra_conf
=
False
def
keep_load_extra_conf
(
self
):
def
func
():
...
...
coco/conf.py
View file @
d0238e3f
...
...
@@ -298,6 +298,10 @@ class Config(dict):
if
value
is
not
None
:
if
value
.
isdigit
():
value
=
int
(
value
)
elif
value
.
lower
()
==
'false'
:
value
=
False
elif
value
.
lower
()
==
'true'
:
value
=
True
return
value
return
self
.
defaults
.
get
(
item
)
...
...
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