[node-patches] Change in ovirt-node[master]: init: Add support for keyboard layout cmdline args

hadong0720 at gmail.com hadong0720 at gmail.com
Sun Aug 25 06:13:55 UTC 2013


hadong has uploaded a new change for review.

Change subject: init: Add support for keyboard layout cmdline args
......................................................................

init: Add support for keyboard layout cmdline args

This patch adds support for setting keyboard layout in cmdline args:
keyboard=layout(eg:keyboard=us)
This informations are sued to set keyboard layout during
an auto-installation.

Change-Id: I9f0f972c4b2cef433269567f25646869d010d30b
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=960846
Signed-off-by: hadong <hadong0720 at gmail.com>
---
M scripts/ovirt-auto-install.py
1 file changed, 17 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/55/18455/1

diff --git a/scripts/ovirt-auto-install.py b/scripts/ovirt-auto-install.py
index 12e5aa7..2c21916 100755
--- a/scripts/ovirt-auto-install.py
+++ b/scripts/ovirt-auto-install.py
@@ -25,6 +25,7 @@
 from ovirtnode.log import *
 from ovirtnode.kdump import *
 from ovirt.node.utils.console import TransactionProgress
+from ovirt.node.utils import system
 import logging
 import sys
 
@@ -69,6 +70,18 @@
                     "no")
         ovirt_store_config("/etc/ssh/sshd_config")
         system_closefds("service sshd restart &> /dev/null")
+
+
+class SetKeyboardLayoutAuthentication(Transaction.Element):
+    title = "Setting Keyboard Layout"
+
+    def commit(self):
+        if "OVIRT_KEYBOARD_LAYOUT" in OVIRT_VARS and \
+           not OVIRT_VARS["OVIRT_KEYBOARD_LAYOUT"] is "":
+            kbd = system.Keyboard()
+            kbd.set_layout(OVIRT_VARS["OVIRT_KEYBOARD_LAYOUT"])
+            ovirt_store_config("/etc/vconsole.conf")
+            ovirt_store_config("/etc/sysconfig/keyboard")
 
 
 class ConfigureLogging(Transaction.Element):
@@ -140,6 +153,10 @@
     if "OVIRT_SSH_PWAUTH" in OVIRT_VARS:
         tx.append(EnableSshPasswordAuthentication())
 
+    #set keyboard_layout
+    if "OVIRT_KEYBOARD_LAYOUT" in OVIRT_VARS:
+        tx.append(SetKeyboardLayoutAuthentication())
+
     tx.append(ConfigureLogging())
 
     tx.append(ConfigureCollectd())


-- 
To view, visit http://gerrit.ovirt.org/18455
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f0f972c4b2cef433269567f25646869d010d30b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: hadong <hadong0720 at gmail.com>



More information about the node-patches mailing list