summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/system-display.py25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/conf_mode/system-display.py b/src/conf_mode/system-display.py
index 9ab35a331..3eafc30c0 100755
--- a/src/conf_mode/system-display.py
+++ b/src/conf_mode/system-display.py
@@ -27,18 +27,11 @@ from vyos import airbag
airbag.enable()
def get_config():
+ conf = Config()
+ base = ['system', 'display']
+ display = conf.get_config_dict(base, key_mangling=('-', '_'), get_first_key=True)
# Return a (possibly empty) configuration dictionary
- return Config().get_config_dict(['system', 'display'])
-
-def generate(config_dict):
- if not config_dict:
- return None
- # Render config file for daemon LCDd
- render('/run/LCDd/LCDd.lo.conf', 'system-display/LCDd.conf.tmpl', config_dict)
- # Render config file for client lcdproc
- render('/run/lcdproc/lcdproc.lo.conf', 'system-display/lcdproc.conf.tmpl', config_dict)
-
- return None
+ return display
def verify(config_dict):
if not config_dict:
@@ -68,6 +61,16 @@ def verify(config_dict):
return None
+def generate(config_dict):
+ if not config_dict:
+ return None
+ # Render config file for daemon LCDd
+ render('/run/LCDd/LCDd.lo.conf', 'system-display/LCDd.conf.tmpl', config_dict)
+ # Render config file for client lcdproc
+ render('/run/lcdproc/lcdproc.lo.conf', 'system-display/lcdproc.conf.tmpl', config_dict)
+
+ return None
+
def apply(config_dict):
# Stop client
run('systemctl stop lcdproc@lo.service')