summaryrefslogtreecommitdiff
path: root/src/conf_mode/system-options.py
diff options
context:
space:
mode:
authorDmitriyEshenko <dmitriy.eshenko@vyos.io>2020-11-13 21:41:15 +0000
committerDmitriyEshenko <dmitriy.eshenko@vyos.io>2020-11-13 21:41:15 +0000
commitd6ab086a744fe8e1d5bc071ccd8f0cfa4d272e55 (patch)
treed9418b636ee810e34d5a611b915c393493ec9a49 /src/conf_mode/system-options.py
parent943a4a5016cfc75a352bb3711b5c4c8bfe32b740 (diff)
downloadvyos-1x-d6ab086a744fe8e1d5bc071ccd8f0cfa4d272e55.tar.gz
vyos-1x-d6ab086a744fe8e1d5bc071ccd8f0cfa4d272e55.zip
system: T3038: Add keyboard layout CLI command
Diffstat (limited to 'src/conf_mode/system-options.py')
-rwxr-xr-xsrc/conf_mode/system-options.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/conf_mode/system-options.py b/src/conf_mode/system-options.py
index 22765cef7..bf0bd56ec 100755
--- a/src/conf_mode/system-options.py
+++ b/src/conf_mode/system-options.py
@@ -107,6 +107,15 @@ def apply(options):
else:
cmd('systemctl disable tuned.service')
+ # Keyboard layout
+ if 'keyboard_layout' in options.keys():
+ try:
+ cmd('loadkeys {}'.format(options['keyboard_layout']))
+ except OSError:
+ raise ConfigError('Dos not possible to set {} as keyboard layout'.format(options['keyboard_layout']))
+ else:
+ cmd('loadkeys us')
+
if __name__ == '__main__':
try:
c = get_config()