diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-06-14 19:00:49 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-06-18 21:45:40 +0200 |
commit | b02de1795f5b77d846bc7a6a1cce4e8fd1246e04 (patch) | |
tree | 4998739ef2197564796b8e72a759cc2aff02c5be /src | |
parent | 6727ddc78035c14ca5015419ef4a9240af8288d8 (diff) | |
download | vyos-1x-b02de1795f5b77d846bc7a6a1cce4e8fd1246e04.tar.gz vyos-1x-b02de1795f5b77d846bc7a6a1cce4e8fd1246e04.zip |
console-server: T2490: rename CLI to "serial-proxy"
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/system_serial-proxy.py (renamed from src/conf_mode/ser2net.py) | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/conf_mode/ser2net.py b/src/conf_mode/system_serial-proxy.py index ec8afcb48..83369d39d 100755 --- a/src/conf_mode/ser2net.py +++ b/src/conf_mode/system_serial-proxy.py @@ -31,9 +31,9 @@ default_config_data = { } def get_config(): - ser2net = deepcopy(default_config_data) + proxy = deepcopy(default_config_data) conf = Config() - base = ['service', 'ser2net'] + base = ['service', 'serial-proxy'] if not conf.exists(base): return None @@ -67,15 +67,15 @@ def get_config(): if conf.exists(['speed']): serial['speed'] = conf.return_value(['speed']) - ser2net['devices'].append(serial) + proxy['devices'].append(serial) - return ser2net + return proxy -def verify(ser2net): - if not ser2net: +def verify(proxy): + if not proxy: return None - for device in ser2net['devices']: + for device in proxy['devices']: if not os.path.exists('{serial_port}'.format(**device)): raise ConfigError('Serial interface "{serial_port} does not exist"' .format(**device)) @@ -87,22 +87,22 @@ def verify(ser2net): return None -def generate(ser2net): - if not ser2net: +def generate(proxy): + if not proxy: return None - render(config_file, 'ser2net/ser2net.conf.tmpl', ser2net) + render(config_file, 'ser2net/ser2net.conf.tmpl', proxy) return None -def apply(ser2net): - if not ser2net: +def apply(proxy): + if not proxy: call('systemctl stop ser2net.service') if os.path.isfile(config_file): os.unlink(config_file) return None - call('systemctl restart ser2net.service') + call('systemctl start ser2net.service') return None if __name__ == '__main__': |