Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mimic: ceph-volume: prints log messages to stdout #29602

Merged
merged 2 commits into from Aug 14, 2019
Merged

Conversation

@jan--f
Copy link
Member

jan--f commented Aug 12, 2019

tchaikov and others added 2 commits Mar 24, 2019
python determins the encoding of stdout and stderr based on the LC_CTYPE
and PYTHONIOENCODING env variable, by default, python3's sys.stdout uses
'utf-8' as its encoding, so it will be able to write unicode string even
the stdout is not attached to a tty device. but when it comes to
python2, it will default to ascii if neither of these variabls is set.
so, if we are writing unicode using `_Write` in an environment where
LC_CTYPE and/or PYTHONIOENCODING are using non UTF-8 encoding, it chokes
by raising `UnicodeEncodeError` exception.

in this change, we add a wrapper around `_Write._writer` so it is able
to write unicode string in such a non-unicode-friendly environment.

for more info related the encoding of stdout and stderr, see
https://docs.python.org/3/using/cmdline.html#envvar-PYTHONIOENCODING .

Signed-off-by: Alfredo Deza <adeza@redhat.com>
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 77912c0)
We should never print log messages to stdout, as this should be reserved
for output of ceph-volume.

Fixes: https://tracker.ceph.com/issues/41158

Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit b8d6dcb)
@jan--f jan--f self-assigned this Aug 12, 2019
@jan--f jan--f added this to the mimic milestone Aug 12, 2019
@jan--f jan--f requested a review from alfredodeza Aug 12, 2019
@jan--f

This comment has been minimized.

Copy link
Member Author

jan--f commented Aug 12, 2019

jenkins test ceph-volume tox

@jan--f jan--f merged commit 7d94c19 into ceph:mimic Aug 14, 2019
3 of 5 checks passed
3 of 5 checks passed
Docs: build check Docs: failed with errors
Details
ceph-volume tox testing ceph-volume tox failed
Details
Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details
@smithfarm smithfarm changed the title mimic: ceph-volume prints log messages to stdout mimic: ceph-volume: prints log messages to stdout Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.