[libvirt] [jenkins-ci PATCH] lcitool: Generate the en_US.UTF-8 locale for deb containers

Fabiano Fidêncio fidencio at redhat.com
Mon Sep 9 11:47:03 UTC 2019


osinfo-db tests require "en_US.UTF-8" locate to be set. Since commit
3b682c416b0d the locales are installed but we have to actually generate
it for the containers.

The reason we don't have to do that for the virtual machines is because
the preseed file used for installed them already forces it:
```
 # Environment configuration
 #
 # Locale, keyboard and timezone. All these will be configured again
 # later with Ansible, but they're required information so we must
 # provide them
 d-i debian-installer/locale string en_US.UTF-8
```

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

diff --git a/guests/lcitool b/guests/lcitool
index 5cf8efe..5b5b622 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -675,7 +675,9 @@ class Application:
                     {package_manager} dist-upgrade -y && \\
                     {package_manager} install --no-install-recommends -y {pkgs} && \\
                     {package_manager} autoremove -y && \\
-                    {package_manager} autoclean -y
+                    {package_manager} autoclean -y && \\
+                    sed -Ei 's,^# (en_US\.UTF-8 .*)$,\\1,' /etc/locale.gen && \\
+                    dpkg-reconfigure locales
             """).format(**varmap))
             if args.cross_arch:
                 # Intentionally a separate RUN command from the above
-- 
2.21.0




More information about the libvir-list mailing list