summaryrefslogtreecommitdiff
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
parent1f5bfafc572a26b84c60a2e37d2dffa1e5fc0dfb (diff)
downloadvyos-1x-a9ef9748ce48e96b1c0be0237f77bd8e951ef69a.tar.gz
vyos-1x-a9ef9748ce48e96b1c0be0237f77bd8e951ef69a.zip
Python/ifconfig: T1557: refactor BridgeIf 'forward_delay' property to set_forward_delay()
-rw-r--r--python/vyos/ifconfig.py21
-rwxr-xr-xsrc/conf_mode/interface-bridge.py2
2 files changed, 4 insertions, 19 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))
diff --git a/src/conf_mode/interface-bridge.py b/src/conf_mode/interface-bridge.py
index 3690a144e..7380799ee 100755
--- a/src/conf_mode/interface-bridge.py
+++ b/src/conf_mode/interface-bridge.py
@@ -189,7 +189,7 @@ def apply(bridge):
# set ageing time
br.ageing_time = bridge['aging']
# set bridge forward delay
- br.forward_delay = bridge['forwarding_delay']
+ br.set_forward_delay(bridge['forwarding_delay'])
# set hello time
br.hello_time = bridge['hello_time']
# set max message age