From cc92d54c5b231c6b2c09cd7bc2650b71d8f5a93d Mon Sep 17 00:00:00 2001 From: Ales Musil Date: Wed, 6 May 2020 16:19:24 +0200 Subject: [PATCH] vdsm: Use UTF8 as default locale 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 --- init/daemonAdapter | 2 +- init/vdsmd_init_common.sh.in | 2 +- tests/check_rpms.sh | 2 +- tests/run_tests_local.sh.in | 2 +- tox.ini | 2 +- vdsm.spec.in | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/init/daemonAdapter b/init/daemonAdapter index 280d50711f..5ff1503502 100755 --- a/init/daemonAdapter +++ b/init/daemonAdapter @@ -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, }) diff --git a/init/vdsmd_init_common.sh.in b/init/vdsmd_init_common.sh.in index 623f567a4c..7a14511944 100755 --- a/init/vdsmd_init_common.sh.in +++ b/init/vdsmd_init_common.sh.in @@ -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 diff --git a/tests/check_rpms.sh b/tests/check_rpms.sh index f12c5c4d13..716d755c7e 100755 --- a/tests/check_rpms.sh +++ b/tests/check_rpms.sh @@ -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 diff --git a/tests/run_tests_local.sh.in b/tests/run_tests_local.sh.in index 0a7aabcdfb..4c9824d799 100644 --- a/tests/run_tests_local.sh.in +++ b/tests/run_tests_local.sh.in @@ -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} \ diff --git a/tox.ini b/tox.ini index fbd3ff5607..69bf21f594 100644 --- a/tox.ini +++ b/tox.ini @@ -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 diff --git a/vdsm.spec.in b/vdsm.spec.in index 048037c6e7..0f13a0e415 100644 --- a/vdsm.spec.in +++ b/vdsm.spec.in @@ -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 \