summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-09-24 18:21:05 +0200
committerChristian Poessinger <christian@poessinger.com>2019-09-24 18:21:05 +0200
commita9ef9748ce48e96b1c0be0237f77bd8e951ef69a (patch)
tree0a5b536e3fbc2efdbff7cc6e9512a1033717718c /python
parent1f5bfafc572a26b84c60a2e37d2dffa1e5fc0dfb (diff)
downloadvyos-1x-a9ef9748ce48e96b1c0be0237f77bd8e951ef69a.tar.gz
vyos-1x-a9ef9748ce48e96b1c0be0237f77bd8e951ef69a.zip
Python/ifconfig: T1557: refactor BridgeIf 'forward_delay' property to set_forward_delay()
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig.py21
1 files changed, 3 insertions, 18 deletions
diff --git a/python/vyos/ifconfig.py b/python/vyos/ifconfig.py
index c3dcd86c5..2a30857ab 100644
--- a/python/vyos/ifconfig.py
+++ b/python/vyos/ifconfig.py
@@ -769,29 +769,14 @@ class BridgeIf(Interface):
return self._write_sysfs('/sys/class/net/{}/bridge/ageing_time'
.format(self._ifname), time)
- @property
- def forward_delay(self):
- """
- Get bridge forwarding delay in seconds. Internal Kernel representation
- is in centiseconds.
-
- Example:
- >>> from vyos.ifconfig import Interface
- >>> BridgeIf('br0').ageing_time
- '3'
- """
- return (self._read_sysfs('/sys/class/net/{}/bridge/forward_delay'
- .format(self._ifname)) / 100)
-
- @forward_delay.setter
- def forward_delay(self, time):
+ def set_forward_delay(self, time):
"""
Set bridge forwarding delay in seconds. Internal Kernel representation
is in centiseconds.
Example:
- >>> from vyos.ifconfig import Interface
- >>> BridgeIf('br0').forward_delay = 15
+ >>> from vyos.ifconfig import BridgeIf
+ >>> BridgeIf('br0').forward_delay(15)
"""
return self._write_sysfs('/sys/class/net/{}/bridge/forward_delay'
.format(self._ifname), (int(time) * 100))