Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.core
Commits
c73b726a
Commit
c73b726a
authored
Mar 15, 2019
by
Samuel GAIST
Browse files
[dock] Code cleanup
parent
b04a3cdd
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/core/dock.py
View file @
c73b726a
...
...
@@ -49,7 +49,7 @@ import socket
import
tempfile
import
time
import
docker
import
subprocess
as
sp
import
subprocess
as
sp
# nosec
import
logging
from
beat.core
import
stats
...
...
@@ -140,14 +140,14 @@ class Host(object):
self
.
processing_environments
.
keys
(),
)
)[
0
]
except
:
except
IndexError
:
try
:
return
list
(
filter
(
lambda
x
:
x
.
startswith
(
name
+
" ("
),
self
.
db_environments
.
keys
()
)
)[
0
]
except
:
except
IndexError
:
return
None
@
property
...
...
@@ -245,10 +245,10 @@ class Host(object):
replacement
=
True
else
:
keep
=
True
except
:
except
Exception
:
replacement
=
True
except
:
except
Exception
:
keep
=
True
elif
new_version
is
not
None
:
...
...
@@ -493,7 +493,7 @@ class Host(object):
try
:
return
simplejson
.
loads
(
stdout
)[
0
][
"State"
][
"Status"
]
except
:
except
Exception
:
return
None
def
logs
(
self
,
container
):
...
...
@@ -569,7 +569,7 @@ class Host(object):
status
=
self
.
wait
(
container
)
output
=
self
.
logs
(
container
)
except
Exception
as
e
:
except
Exception
:
return
1
,
None
finally
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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