Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
argo
nrm
Commits
d4c8aa1d
Commit
d4c8aa1d
authored
Apr 18, 2019
by
Valentin Reis
Browse files
[feature] makes `cmd` flush its stdout more aggressively.
This gives automation tools an easier time when streaming data from it.
parent
255e4bc9
Pipeline
#6461
passed with stages
in 4 minutes and 11 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
bin/cmd
View file @
d4c8aa1d
...
...
@@ -83,14 +83,12 @@ class CommandLineInterface(object):
if
msg
.
type
==
"power"
:
print
(
"%s, %s, %s"
%
(
msg
.
type
,
time
.
time
(),
msg
.
total
))
sys
.
stdout
.
flush
()
if
msg
.
type
==
"container_exit"
:
print
(
"%s, %s, %s"
%
(
msg
.
type
,
time
.
time
(),
msg
.
profile_data
))
sys
.
stdout
.
flush
()
else
:
print
(
"%s, %s"
%
(
msg
.
type
,
time
.
time
()))
sys
.
stdout
.
flush
()
sys
.
stdout
.
flush
()
print_if_filter
()
# if argv.uuid:
...
...
@@ -157,12 +155,14 @@ class CommandLineInterface(object):
outeof
=
True
else
:
print
(
msg
.
payload
)
sys
.
stdout
.
flush
()
elif
msg
.
type
==
'stderr'
:
logger
.
debug
(
"container msg: %r"
,
msg
)
if
msg
.
payload
==
'eof'
:
erreof
=
True
else
:
print
(
msg
.
payload
,
file
=
sys
.
stderr
)
sys
.
stdout
.
flush
()
elif
msg
.
type
==
'process_exit'
:
logger
.
info
(
"process ended: %r"
,
msg
)
state
=
'exiting'
...
...
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