[libvirt] [jenkins-ci PATCH] lcitool: Force LANG=en_US.UTF-8 for the containers

Fabiano Fidêncio fidencio at redhat.com
Thu Oct 10 15:13:58 UTC 2019


As we cannot and should not rely on how the containers were generated,
let's force the container LANG to be en_US.UTF-8 otherwise some
containers (Debian 9, Ubuntu 16, and Ubuntu 18) would simply bail when
dealing with environment variables inherited from Gitlab CI which
contains non-POSIX characteres, such as "Fidêncio".

Unfortunately, there's no standard way to do this accross different
distros, leaving us with this "happy little accident" of setting up LANG
in the way it's done right now.

Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
---
 guests/lcitool | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/guests/lcitool b/guests/lcitool
index 49bb50b..a630971 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -735,6 +735,10 @@ class Application:
                 RUN pip3 install {pip_pkgs}
             """).format(**varmap))
 
+        sys.stdout.write(textwrap.dedent("""
+            ENV LANG "en_US.UTF-8"
+        """).format(**varmap))
+
         if args.cross_arch:
             sys.stdout.write(textwrap.dedent("""
                 ENV ABI "{cross_abi}"
-- 
2.23.0




More information about the libvir-list mailing list