Skip to content

Commit

Permalink
ceph-volume: process: write stdin using "Popen.stdin"
Browse files Browse the repository at this point in the history
we cannot use process.communicate() to feed the Popen with input,
because, upon return of process.communicate() the stdout,stderr are
closed. so, we need to write to Popen.stdin property instead.

Signed-off-by: Kefu Chai <kchai@redhat.com>
  • Loading branch information
tchaikov committed Dec 2, 2017
1 parent 23805c5 commit ca59586
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ceph-volume/ceph_volume/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ def run(command, **kw):
)

if stdin:
process.communicate(stdin)
process.stdin.write(stdin)
process.stdin.close()
while True:
reads, _, _ = select(
[process.stdout.fileno(), process.stderr.fileno()],
Expand Down

0 comments on commit ca59586

Please sign in to comment.