summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-09-24 18:17:05 +0200
committerChristian Poessinger <christian@poessinger.com>2019-09-24 18:17:05 +0200
commit63dbedffa7c053e11d0ba5f538d12cbfc8b9e73f (patch)
tree7a765a6588d015c353704835ddb4524e16b873af
parent1e373c5ea5a8ac6a5a4f99376d6399b82df00efa (diff)
downloadvyos-1x-63dbedffa7c053e11d0ba5f538d12cbfc8b9e73f.tar.gz
vyos-1x-63dbedffa7c053e11d0ba5f538d12cbfc8b9e73f.zip
Python/ifconfig: T1557: refactor BridgeIf 'multicast_querier' property to set_multicast_querier()
-rw-r--r--python/vyos/ifconfig.py18
-rwxr-xr-xsrc/conf_mode/interface-bridge.py2
2 files changed, 4 insertions, 16 deletions
diff --git a/python/vyos/ifconfig.py b/python/vyos/ifconfig.py
index f55c5fd5c..0c3a3d0c8 100644
--- a/python/vyos/ifconfig.py
+++ b/python/vyos/ifconfig.py
@@ -909,21 +909,8 @@ class BridgeIf(Interface):
else:
raise ValueError("Value out of range")
- @property
- def multicast_querier(self):
- """
- Get bridge multicast querier membership state.
- Example:
- >>> from vyos.ifconfig import Interface
- >>> BridgeIf('br0').multicast_querier
- '0'
- """
- return self._read_sysfs('/sys/class/net/{}/bridge/multicast_querier'
- .format(self._ifname))
-
- @multicast_querier.setter
- def multicast_querier(self, enable):
+ def set_multicast_querier(self, enable):
"""
Sets whether the bridge actively runs a multicast querier or not. When a
bridge receives a 'multicast host membership' query from another network
@@ -934,7 +921,7 @@ class BridgeIf(Interface):
Example:
>>> from vyos.ifconfig import Interface
- >>> BridgeIf('br0').multicast_querier = 1
+ >>> BridgeIf('br0').set_multicast_querier(1)
"""
if int(enable) >= 0 and int(enable) <= 1:
return self._write_sysfs('/sys/class/net/{}/bridge/multicast_querier'
@@ -942,6 +929,7 @@ class BridgeIf(Interface):
else:
raise ValueError("Value out of range")
+
def add_port(self, interface):
"""
Add physical interface to bridge (member port)
diff --git a/src/conf_mode/interface-bridge.py b/src/conf_mode/interface-bridge.py
index 6be7d6714..0adbb0617 100755
--- a/src/conf_mode/interface-bridge.py
+++ b/src/conf_mode/interface-bridge.py
@@ -199,7 +199,7 @@ def apply(bridge):
# turn stp on/off
br.stp_state = bridge['stp']
# enable or disable IGMP querier
- br.multicast_querier = bridge['igmp_querier']
+ br.set_multicast_querier(bridge['igmp_querier'])
# update interface description used e.g. within SNMP
br.ifalias = bridge['description']