Skip to content

Commit

Permalink
vdsm: Use UTF8 as default locale
Browse files Browse the repository at this point in the history
To be able to use unicode in commands we need to
switch every locale in vdsm to use UTF8 instead
of ASCII.

Change-Id: I3a6109a450a69f37f48e83ff9b5db157d19e028e
Signed-off-by: Ales Musil <[email protected]>
  • Loading branch information
almusil authored and mz-pdm committed May 12, 2020
1 parent e727178 commit cc92d54
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion init/daemonAdapter
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class DaemonAdapter(object):
'vars', 'libvirt_env_variable_log_filters'),
'LIBVIRT_LOG_OUTPUTS': config.get(
'vars', 'libvirt_env_variable_log_outputs'),
'LC_ALL': 'C',
'LC_ALL': 'C.UTF8',
'PYTHONPATH': pythonpath,
})

Expand Down
2 changes: 1 addition & 1 deletion init/vdsmd_init_common.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ task_test_space() {


task_test_lo() {
if ! LC_ALL=C "@IP_PATH@" link show lo | "@GREP_PATH@" -q UP; then
if ! LC_ALL=C.UTF8 "@IP_PATH@" link show lo | "@GREP_PATH@" -q UP; then
echo "VDSMD: lo interface is down, can't run !"
echo "VDSMD: lo interface is down, can't run !" > /dev/kmsg
return 1
Expand Down
2 changes: 1 addition & 1 deletion tests/check_rpms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ shopt -s extglob

ARTIFACTS_DIR=$1

export LC_ALL=C # no idea why this is suddenly needed
export LC_ALL=C.UTF8 # no idea why this is suddenly needed

rpmlint "$ARTIFACTS_DIR/"*.src.rpm

Expand Down
2 changes: 1 addition & 1 deletion tests/run_tests_local.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function terminate_jobs {
trap terminate_jobs EXIT

export \
LC_ALL=C \
LC_ALL=C.UTF8 \
NOSE_EVAL_ATTR \
NOSE_LOGFORMAT='%(asctime)s %(levelname)-5s (%(threadName)s) [%(name)s] %(message)s (%(module)s:%(lineno)d)' \
NOSE_VERBOSE=${NOSE_VERBOSE:-1} \
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ whitelist_externals = profile
passenv = *
setenv =
PYTHONPATH = {toxinidir}/lib
LC_ALL = C
LC_ALL = C.UTF8
deps =
nose==1.3.7
pytest-cov==2.8.1
Expand Down
2 changes: 1 addition & 1 deletion vdsm.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ make DESTDIR=%{buildroot} install

%pre
# Force standard locale behavior (English)
export LC_ALL=C
export LC_ALL=C.UTF8

/usr/bin/getent passwd %{vdsm_user} >/dev/null || \
/usr/sbin/useradd -r -u 36 -g %{vdsm_group} -d /var/lib/vdsm \
Expand Down

0 comments on commit cc92d54

Please sign in to comment.