Re: /etc/sysconfig/keyboard syntax subtilities

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

 



Guillaume Rousse wrote:
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.

Patch forwarded to Fedora/Linux Management Tools <et-mgmt-tools@xxxxxxxxxx> list.

Rich.

--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903
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

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]