the data read from stdin is used as the input parameter for calls like
`cluster.osd_command(...)` and `cluster.mon_command`. all of them
expect a bytes `inbuf`. in Python2, this sys.stdin.read() returns a str,
and we don't differentiate str from byte back then. but we need enforce
the type now for better readablity and type correctness.
Signed-off-by: Kefu Chai <kchai@redhat.com>
if parsed_args.input_file:
try:
if parsed_args.input_file == '-':
- inbuf = sys.stdin.read()
+ inbuf = sys.stdin.buffer.read()
else:
with open(parsed_args.input_file, 'rb') as f:
inbuf = f.read()