summaryrefslogtreecommitdiff
path: root/src/conf_mode/system_serial-proxy.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-06-14 19:32:13 +0200
committerChristian Poessinger <christian@poessinger.com>2020-06-18 21:45:51 +0200
commitf1f2b647195db515e55a769370b4a689a4dafa44 (patch)
treefd7e13dce67315d725e0807ed8f4f314cf5bf6ba /src/conf_mode/system_serial-proxy.py
parentb02de1795f5b77d846bc7a6a1cce4e8fd1246e04 (diff)
downloadvyos-1x-f1f2b647195db515e55a769370b4a689a4dafa44.tar.gz
vyos-1x-f1f2b647195db515e55a769370b4a689a4dafa44.zip
console-server: T2490: add default CLI values
Diffstat (limited to 'src/conf_mode/system_serial-proxy.py')
-rwxr-xr-xsrc/conf_mode/system_serial-proxy.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/conf_mode/system_serial-proxy.py b/src/conf_mode/system_serial-proxy.py
index 83369d39d..007277918 100755
--- a/src/conf_mode/system_serial-proxy.py
+++ b/src/conf_mode/system_serial-proxy.py
@@ -43,12 +43,12 @@ def get_config():
for serial_port in conf.list_nodes(['device']):
conf.set_level(base + ['device', serial_port])
serial = {
- 'data_bits': '',
- 'parity': '',
+ 'data_bits': '8',
+ 'parity': 'none',
'port': '',
'serial_port': '/dev/serial/by-bus/' + serial_port,
'speed': '',
- 'stop_bits': '',
+ 'stop_bits': '1',
'timeout': '600'
}
@@ -80,10 +80,11 @@ def verify(proxy):
raise ConfigError('Serial interface "{serial_port} does not exist"'
.format(**device))
- for key in ['data_bits', 'parity', 'port', 'speed', 'stop_bits']:
- if not device[key]:
- value = key.replace('_','-')
- raise ConfigError(f'{value} option must be defined!')
+ if not device['port']:
+ raise ConfigError(f'Port must be defined!')
+
+ if not device['speed']:
+ raise ConfigError(f'Speed must be defined!')
return None