From 46f4aa47cc62ca05bef4e4cca614ed77065608e7 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 22 Jun 2020 22:34:06 +0200 Subject: console-server: T2588: migrate to defaults from XML interface definitions --- src/conf_mode/service_console-server.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/conf_mode/service_console-server.py b/src/conf_mode/service_console-server.py index 7f6967983..ace6b8ca4 100755 --- a/src/conf_mode/service_console-server.py +++ b/src/conf_mode/service_console-server.py @@ -22,17 +22,11 @@ from vyos.config import Config from vyos.configdict import dict_merge from vyos.template import render from vyos.util import call +from vyos.xml import defaults from vyos import ConfigError config_file = r'/run/conserver/conserver.cf' -# Default values are necessary until the implementation of T2588 is completed -default_values = { - 'data_bits': '8', - 'parity': 'none', - 'stop_bits': '1' -} - def get_config(): conf = Config() base = ['service', 'console-server'] @@ -52,6 +46,7 @@ def get_config(): # We have gathered the dict representation of the CLI, but there are default # options which we need to update into the dictionary retrived. + default_values = defaults(base + ['device']) for device in proxy['device'].keys(): tmp = dict_merge(default_values, proxy['device'][device]) proxy['device'][device] = tmp -- cgit v1.2.3