[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libvir] /etc/sysconfig/keyboard syntax subtilities



virtmanager split content of /etc/sysconfig/keyboard on '"' for
determining keyboard. On mandriva system, there isn't any quote in this
file: see http://qa.mandriva.com/show_bug.cgi?id=34190

Here is a patch making parsing of this file a bit more robust.
-- 
Guillaume Rousse
Moyens Informatiques - INRIA Futurs
Tel: 01 69 35 69 62
diff -Naur virt-manager-0.5.0/src/virtManager/create.py virt-manager-0.5.0.keyboard/src/virtManager/create.py
--- virt-manager-0.5.0/src/virtManager/create.py	2007-08-29 23:09:47.000000000 +0200
+++ virt-manager-0.5.0.keyboard/src/virtManager/create.py	2007-09-27 14:14:56.000000000 +0200
@@ -540,7 +540,12 @@
                 if s == "":
                     break
                 if re.search("KEYTABLE", s) != None:
-                    kt = s.split('"')[1]
+                    kt = s.split('=')[1]
+		    # take care of potential quotes
+		    p = re.compile('["\']([-\w]+)["\']')
+		    m = p.match(kt)
+		    if m:
+		        kt = m.group(1)
                     if keytable.keytable.has_key(kt):
                         keymap = keytable.keytable[kt]
             f.close

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]