Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
19
Merge Requests
19
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
30e37b73
Commit
30e37b73
authored
Oct 10, 2018
by
Bryton Lacquement
🚪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
f442fdbd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
slapos/grid/utils.py
slapos/grid/utils.py
+7
-9
No files found.
slapos/grid/utils.py
View file @
30e37b73
...
@@ -116,7 +116,7 @@ class SlapPopen(subprocess.Popen):
...
@@ -116,7 +116,7 @@ class SlapPopen(subprocess.Popen):
# don't leak log & co. filedescriptors to child process
# don't leak log & co. filedescriptors to child process
kwargs
.
setdefault
(
'close_fds'
,
True
)
kwargs
.
setdefault
(
'close_fds'
,
True
)
subprocess
.
Popen
.
__init__
(
self
,
universal_newlines
=
True
,
*
args
,
**
kwargs
)
subprocess
.
Popen
.
__init__
(
self
,
*
args
,
**
kwargs
)
if
debug
:
if
debug
:
self
.
wait
()
self
.
wait
()
self
.
output
=
'(output not captured in debug mode)'
self
.
output
=
'(output not captured in debug mode)'
...
@@ -125,15 +125,13 @@ class SlapPopen(subprocess.Popen):
...
@@ -125,15 +125,13 @@ class SlapPopen(subprocess.Popen):
self
.
stdin
.
close
()
self
.
stdin
.
close
()
self
.
stdin
=
None
self
.
stdin
=
None
# XXX-Cedric: this algorithm looks overkill for simple logging.
output_lines
=
[]
output_lines
=
[]
while
True
:
for
line
in
self
.
stdout
:
line
=
self
.
stdout
.
readline
()
if
type
(
line
)
is
not
str
:
if
line
==
''
and
self
.
poll
()
is
not
None
:
line
=
line
.
decode
(
errors
=
'replace'
)
break
if
line
:
output_lines
.
append
(
line
)
output_lines
.
append
(
line
)
logger
.
info
(
line
.
rstrip
(
'
\
n
'
))
logger
.
info
(
line
.
rstrip
(
'
\
n
'
))
self
.
wait
()
self
.
output
=
''
.
join
(
output_lines
)
self
.
output
=
''
.
join
(
output_lines
)
...
...
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