From 627d1c704c83efe973b16db61005aacb1a96aead Mon Sep 17 00:00:00 2001 From: Thomas Mangin Date: Fri, 27 Mar 2020 18:10:49 +0000 Subject: ifconfig: T2057: explicity name state functions The Interface get_state/set_state were not clear about if they edited the admin or operational state. functions are now using admin_state and oper_state for clarity. --- python/vyos/ifconfig/control.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'python/vyos/ifconfig/control.py') diff --git a/python/vyos/ifconfig/control.py b/python/vyos/ifconfig/control.py index 28adc80d1..e8f25c014 100644 --- a/python/vyos/ifconfig/control.py +++ b/python/vyos/ifconfig/control.py @@ -44,7 +44,7 @@ class Control(Register): Using the defined names, set data write to sysfs. """ cmd = self._command_get[name]['shellcmd'].format(**config) - return self._cmd(cmd) + return self._command_get[name].get('format', lambda _: _)(self._cmd(cmd)) def _set_command(self, config, name, value): """ @@ -70,7 +70,7 @@ class Control(Register): config = {**config, **{'value': value}} cmd = self._command_set[name]['shellcmd'].format(**config) - return self._cmd(cmd) + return self._command_set[name].get('format', lambda _: _)(self._cmd(cmd)) _sysfs_get = {} _sysfs_set = {} -- cgit v1.2.3