summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-09-24 18:26:28 +0200
committerChristian Poessinger <christian@poessinger.com>2019-09-24 21:53:25 +0200
commit2f458f5efbd95640780554cc83fb54ec790bd4cc (patch)
treeaa20be6c048a30e02cb086fb198c4d7615d23940 /python/vyos
parent839058e95311ed6ee08f96a943c271dbf77320ed (diff)
downloadvyos-1x-2f458f5efbd95640780554cc83fb54ec790bd4cc.tar.gz
vyos-1x-2f458f5efbd95640780554cc83fb54ec790bd4cc.zip
Python/ifconfig: T1557: refactor BridgeIf 'priority' property to set_priority()
Diffstat (limited to 'python/vyos')
-rw-r--r--python/vyos/ifconfig.py24
1 files changed, 5 insertions, 19 deletions
diff --git a/python/vyos/ifconfig.py b/python/vyos/ifconfig.py
index 4ffeaa729..6b4d102fb 100644
--- a/python/vyos/ifconfig.py
+++ b/python/vyos/ifconfig.py
@@ -789,27 +789,13 @@ class BridgeIf(Interface):
return self._write_sysfs('/sys/class/net/{}/bridge/max_age'
.format(self._ifname), (int(time) * 100))
- @property
- def priority(self):
- """
- Get bridge max aging time in seconds.
-
- Example:
- >>> from vyos.ifconfig import Interface
- >>> BridgeIf('br0').priority
- '32768'
- """
- return self._read_sysfs('/sys/class/net/{}/bridge/priority'
- .format(self._ifname))
-
- @priority.setter
- def priority(self, priority):
+ def set_priority(self, priority):
"""
Set bridge max aging time in seconds.
Example:
- >>> from vyos.ifconfig import Interface
- >>> BridgeIf('br0').priority = 8192
+ >>> from vyos.ifconfig import BridgeIf
+ >>> BridgeIf('br0').set_priority(8192)
"""
return self._write_sysfs('/sys/class/net/{}/bridge/priority'
.format(self._ifname), priority)
@@ -891,7 +877,7 @@ class BridgeIf(Interface):
cmd = 'ip link set dev {} nomaster'.format(interface)
self._cmd(cmd)
- def set_cost(self, interface, cost):
+ def set_path_cost(self, interface, cost):
"""
Set interface path cost, only relevant for STP enabled interfaces
@@ -903,7 +889,7 @@ class BridgeIf(Interface):
return self._write_sysfs('/sys/class/net/{}/brif/{}/path_cost'
.format(self._ifname, interface), cost)
- def set_priority(self, interface, priority):
+ def set_path_priority(self, interface, priority):
"""
Set interface path priority, only relevant for STP enabled interfaces