summaryrefslogtreecommitdiff
path: root/src/conf_mode/service_console-server.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-06-22 22:34:06 +0200
committerChristian Poessinger <christian@poessinger.com>2020-06-22 22:34:06 +0200
commit46f4aa47cc62ca05bef4e4cca614ed77065608e7 (patch)
tree3924dce686e3b071a20fa355d05fd6e8d8602089 /src/conf_mode/service_console-server.py
parent8857f407b7e04091d9b0db3017d9cbb33391c691 (diff)
downloadvyos-1x-46f4aa47cc62ca05bef4e4cca614ed77065608e7.tar.gz
vyos-1x-46f4aa47cc62ca05bef4e4cca614ed77065608e7.zip
console-server: T2588: migrate to defaults from XML interface definitions
Diffstat (limited to 'src/conf_mode/service_console-server.py')
-rwxr-xr-xsrc/conf_mode/service_console-server.py9
1 files changed, 2 insertions, 7 deletions
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