summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-09-24 18:22:25 +0200
committerChristian Poessinger <christian@poessinger.com>2019-09-24 18:22:25 +0200
commite41213fd082603a7c70e518e52582b7600af8589 (patch)
treeb6e3b7fdbad5a946f13352534a3d43af10959148
parenta9ef9748ce48e96b1c0be0237f77bd8e951ef69a (diff)
downloadvyos-1x-e41213fd082603a7c70e518e52582b7600af8589.tar.gz
vyos-1x-e41213fd082603a7c70e518e52582b7600af8589.zip
Python/ifconfig: T1557: refactor BridgeIf 'hello_time' property to set_hello_time()
-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 2a30857ab..e10e01e2f 100644
--- a/python/vyos/ifconfig.py
+++ b/python/vyos/ifconfig.py
@@ -781,29 +781,14 @@ class BridgeIf(Interface):
return self._write_sysfs('/sys/class/net/{}/bridge/forward_delay'
.format(self._ifname), (int(time) * 100))
- @property
- def hello_time(self):
- """
- Get bridge hello time in seconds. Internal Kernel representation
- is in centiseconds.
-
- Example:
- >>> from vyos.ifconfig import Interface
- >>> BridgeIf('br0').hello_time
- '2'
- """
- return (self._read_sysfs('/sys/class/net/{}/bridge/hello_time'
- .format(self._ifname)) / 100)
-
- @hello_time.setter
- def hello_time(self, time):
+ def set_hello_time(self, time):
"""
Set bridge hello time in seconds. Internal Kernel representation
is in centiseconds.
Example:
- >>> from vyos.ifconfig import Interface
- >>> BridgeIf('br0').hello_time = 2
+ >>> from vyos.ifconfig import BridgeIf
+ >>> BridgeIf('br0').set_hello_time(2)
"""
return self._write_sysfs('/sys/class/net/{}/bridge/hello_time'
.format(self._ifname), (int(time) * 100))
diff --git a/src/conf_mode/interface-bridge.py b/src/conf_mode/interface-bridge.py
index 7380799ee..5d97d49bc 100755
--- a/src/conf_mode/interface-bridge.py
+++ b/src/conf_mode/interface-bridge.py
@@ -191,7 +191,7 @@ def apply(bridge):
# set bridge forward delay
br.set_forward_delay(bridge['forwarding_delay'])
# set hello time
- br.hello_time = bridge['hello_time']
+ br.set_hello_time(bridge['hello_time'])
# set max message age
br.set_max_age(bridge['max_age'])
# set bridge priority