[rhel7-branch][PATCH] Split localed's converted layouts and variants (#1073825)

Vratislav Podzimek vpodzime at redhat.com
Tue Sep 16 08:43:57 UTC 2014


systemd-localed may give use multiple layouts+variants when asked to convert VC
keymap. Try to split it and use the resulting list.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 pyanaconda/keyboard.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/pyanaconda/keyboard.py b/pyanaconda/keyboard.py
index 9c02a1d..27d9510 100755
--- a/pyanaconda/keyboard.py
+++ b/pyanaconda/keyboard.py
@@ -290,7 +290,7 @@ def activate_keyboard(keyboard):
     """
 
     localed = LocaledWrapper()
-    c_lay_var = ""
+    c_lays_vars = []
     c_keymap = ""
 
     if keyboard._keyboard and not (keyboard.vc_keymap or keyboard.x_layouts):
@@ -311,12 +311,15 @@ def activate_keyboard(keyboard):
             keyboard.vc_keymap = None
         else:
             # activate VConsole keymap and get converted layout and variant
-            c_lay_var = localed.set_and_convert_keymap(keyboard.vc_keymap)
+            converted = localed.set_and_convert_keymap(keyboard.vc_keymap)
+
+            # localed may give us multiple comma-separated layouts+variants
+            c_lays_vars = converted.split(",")
 
     if not keyboard.x_layouts:
-        if c_lay_var:
+        if c_lays_vars:
             # suggested by systemd-localed for a requested VConsole keymap
-            keyboard.x_layouts.append(c_lay_var)
+            keyboard.x_layouts += c_lays_vars
         elif keyboard.vc_keymap:
             # nothing suggested by systemd-localed, but we may try to use the
             # same string for both VConsole keymap and X layout (will fail
-- 
1.9.3



More information about the anaconda-patches mailing list