diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-09-24 18:24:39 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-09-24 18:24:39 +0200 |
commit | 839058e95311ed6ee08f96a943c271dbf77320ed (patch) | |
tree | d6ce69df8f5a15ff99025991b2aec18fe360dcc0 /python | |
parent | e41213fd082603a7c70e518e52582b7600af8589 (diff) | |
download | vyos-1x-839058e95311ed6ee08f96a943c271dbf77320ed.tar.gz vyos-1x-839058e95311ed6ee08f96a943c271dbf77320ed.zip |
Python/ifconfig: T1557: refactor BridgeIf 'ageing_time' property to set_ageing_time()
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/ifconfig.py | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/python/vyos/ifconfig.py b/python/vyos/ifconfig.py index e10e01e2f..4ffeaa729 100644 --- a/python/vyos/ifconfig.py +++ b/python/vyos/ifconfig.py @@ -740,30 +740,14 @@ class BridgeIf(Interface): def __init__(self, ifname): super().__init__(ifname, type='bridge') - @property - def ageing_time(self): - """ - Return configured bridge interface MAC address aging time in seconds. - Internal kernel representation is in centiseconds, thus its converted - in the end. Kernel default is 300 seconds. - - Example: - >>> from vyos.ifconfig import Interface - >>> BridgeIf('br0').aging_time - '300' - """ - return (self._read_sysfs('/sys/class/net/{}/bridge/ageing_time' - .format(self._ifname)) / 100) - - @ageing_time.setter - def ageing_time(self, time): + def set_ageing_time(self, time): """ Set bridge interface MAC address aging time in seconds. Internal kernel representation is in centiseconds. Kernel default is 300 seconds. Example: - >>> from vyos.ifconfig import Interface - >>> BridgeIf('br0').ageing_time = 2 + >>> from vyos.ifconfig import BridgeIf + >>> BridgeIf('br0').ageing_time(2) """ time = int(time) * 100 return self._write_sysfs('/sys/class/net/{}/bridge/ageing_time' |