From: Alfredo Deza Date: Fri, 27 Jul 2018 15:14:13 +0000 (-0400) Subject: ceph-volume process use the as_bytes util for stdin X-Git-Tag: v14.0.1~750^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6a9368c1db468e05944607f9814f19053de80b6b;p=ceph.git ceph-volume process use the as_bytes util for stdin Signed-off-by: Alfredo Deza --- diff --git a/src/ceph-volume/ceph_volume/process.py b/src/ceph-volume/ceph_volume/process.py index 1972883fa53f..e70986892b7f 100644 --- a/src/ceph-volume/ceph_volume/process.py +++ b/src/ceph-volume/ceph_volume/process.py @@ -3,6 +3,7 @@ from os import O_NONBLOCK, read import subprocess from select import select from ceph_volume import terminal +from ceph_volume.util import as_bytes import logging @@ -201,9 +202,7 @@ def call(command, **kw): ) if stdin: - stdout_stream, stderr_stream = process.communicate( - stdin.encode(encoding='utf-8', errors='ignore') - ) + stdout_stream, stderr_stream = process.communicate(as_bytes(stdin)) else: stdout_stream = process.stdout.read() stderr_stream = process.stderr.read()