Skip to content

Commit

Permalink
ceph-volume process decode to utf-8 when logging descriptors
Browse files Browse the repository at this point in the history
Signed-off-by: Alfredo Deza <adeza@redhat.com>
  • Loading branch information
Alfredo Deza committed Jul 27, 2018
1 parent 849e3a4 commit c66846d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ceph-volume/ceph_volume/process.py
Expand Up @@ -52,7 +52,10 @@ def log_descriptors(reads, process, terminal_logging):
for descriptor in reads:
descriptor_name = descriptor_names[descriptor]
try:
log_output(descriptor_name, read(descriptor, 1024), terminal_logging, True)
message = read(descriptor, 1024)
if not isinstance(message, str):
message = message.decode('utf-8')
log_output(descriptor_name, message, terminal_logging, True)
except (IOError, OSError):
# nothing else to log
pass
Expand Down

0 comments on commit c66846d

Please sign in to comment.