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
029625dd
Commit
029625dd
authored
Oct 24, 2017
by
Philip ABBET
Browse files
Docker executor: better handling of the log produced inside the container
parent
82deb935
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/core/execution/docker.py
View file @
029625dd
...
...
@@ -417,9 +417,18 @@ class DockerExecutor(BaseExecutor):
# Collects final information and returns to caller
container_log
=
self
.
host
.
stderr
(
algorithm_container
)
stderr
=
''
if
status
!=
0
:
stderr
=
container_log
if
logger
.
getEffectiveLevel
()
<=
logging
.
DEBUG
:
logger
.
debug
(
"Log of the container: "
+
container_log
)
retval
=
dict
(
stdout
=
self
.
host
.
stdout
(
algorithm_container
),
stderr
=
s
elf
.
host
.
stderr
(
algorithm_container
)
,
stderr
=
s
tderr
,
status
=
status
,
timed_out
=
timed_out
,
statistics
=
self
.
host
.
statistics
(
algorithm_container
),
...
...
@@ -434,7 +443,8 @@ class DockerExecutor(BaseExecutor):
if
databases_container
is
not
None
:
retval
[
'stdout'
]
+=
'
\n
'
+
self
.
host
.
stdout
(
databases_container
)
retval
[
'stderr'
]
+=
'
\n
'
+
self
.
host
.
stderr
(
databases_container
)
if
status
!=
0
:
retval
[
'stderr'
]
+=
'
\n
'
+
self
.
host
.
stderr
(
databases_container
)
self
.
host
.
rm
(
databases_container
)
self
.
db_socket
.
setsockopt
(
zmq
.
LINGER
,
0
)
self
.
db_socket
.
close
()
...
...
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