diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-06-14 19:32:13 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-06-18 21:45:51 +0200 |
commit | f1f2b647195db515e55a769370b4a689a4dafa44 (patch) | |
tree | fd7e13dce67315d725e0807ed8f4f314cf5bf6ba /src/conf_mode/system_serial-proxy.py | |
parent | b02de1795f5b77d846bc7a6a1cce4e8fd1246e04 (diff) | |
download | vyos-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-x | src/conf_mode/system_serial-proxy.py | 15 |
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 |