summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-09-24 18:19:37 +0200
committerChristian Poessinger <christian@poessinger.com>2019-09-24 18:19:37 +0200
commit1f5bfafc572a26b84c60a2e37d2dffa1e5fc0dfb (patch)
treeb55e8e6e913f882fd3aa8c7ef5c07f5d492b149b /python
parent63dbedffa7c053e11d0ba5f538d12cbfc8b9e73f (diff)
downloadvyos-1x-1f5bfafc572a26b84c60a2e37d2dffa1e5fc0dfb.tar.gz
vyos-1x-1f5bfafc572a26b84c60a2e37d2dffa1e5fc0dfb.zip
Python/ifconfig: T1557: refactor BridgeIf 'max_age' property to set_max_age()
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig.py20
1 files changed, 2 insertions, 18 deletions
diff --git a/python/vyos/ifconfig.py b/python/vyos/ifconfig.py
index 0c3a3d0c8..c3dcd86c5 100644
--- a/python/vyos/ifconfig.py
+++ b/python/vyos/ifconfig.py
@@ -823,30 +823,14 @@ class BridgeIf(Interface):
return self._write_sysfs('/sys/class/net/{}/bridge/hello_time'
.format(self._ifname), (int(time) * 100))
- @property
- def max_age(self):
- """
- Get bridge max max message age in seconds. Internal Kernel representation
- is in centiseconds.
-
- Example:
- >>> from vyos.ifconfig import Interface
- >>> BridgeIf('br0').max_age
- '20'
- """
-
- return (self._read_sysfs('/sys/class/net/{}/bridge/max_age'
- .format(self._ifname)) / 100)
-
- @max_age.setter
- def max_age(self, time):
+ def set_max_age(self, time):
"""
Set bridge max message age in seconds. Internal Kernel representation
is in centiseconds.
Example:
>>> from vyos.ifconfig import Interface
- >>> BridgeIf('br0').max_age = 30
+ >>> BridgeIf('br0').set_max_age(30)
"""
return self._write_sysfs('/sys/class/net/{}/bridge/max_age'
.format(self._ifname), (int(time) * 100))