summaryrefslogtreecommitdiff
path: root/python/vyos/ifconfig/bridge.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-08-23 14:22:41 +0200
committerChristian Poessinger <christian@poessinger.com>2020-08-23 14:22:41 +0200
commitaa25690c83c4812c92490d29b564dd0330b24d34 (patch)
tree15c5f45b5f82fd5b788c842caeba06d3d81d96f9 /python/vyos/ifconfig/bridge.py
parent20ef1aab793504cf4956dedeeadaf528933b7ccf (diff)
downloadvyos-1x-aa25690c83c4812c92490d29b564dd0330b24d34.tar.gz
vyos-1x-aa25690c83c4812c92490d29b564dd0330b24d34.zip
T2755: convert jmespath.search() to vyos_dict_search() for performance
Diffstat (limited to 'python/vyos/ifconfig/bridge.py')
-rw-r--r--python/vyos/ifconfig/bridge.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/python/vyos/ifconfig/bridge.py b/python/vyos/ifconfig/bridge.py
index 466e6b682..4c76fe996 100644
--- a/python/vyos/ifconfig/bridge.py
+++ b/python/vyos/ifconfig/bridge.py
@@ -13,13 +13,12 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <http://www.gnu.org/licenses/>.
-import jmespath
-
from vyos.ifconfig.interface import Interface
from vyos.ifconfig.stp import STP
from vyos.validate import assert_boolean
from vyos.validate import assert_positive
from vyos.util import cmd
+from vyos.util import vyos_dict_search
@Interface.register
class BridgeIf(Interface):
@@ -223,18 +222,18 @@ class BridgeIf(Interface):
self.set_stp(value)
# enable or disable IGMP querier
- tmp = jmespath.search('igmp.querier', config)
+ tmp = vyos_dict_search('igmp.querier', config)
value = '1' if (tmp != None) else '0'
self.set_multicast_querier(value)
# remove interface from bridge
- tmp = jmespath.search('member.interface_remove', config)
+ tmp = vyos_dict_search('member.interface_remove', config)
if tmp:
for member in tmp:
self.del_port(member)
STPBridgeIf = STP.enable(BridgeIf)
- tmp = jmespath.search('member.interface', config)
+ tmp = vyos_dict_search('member.interface', config)
if tmp:
for interface, interface_config in tmp.items():
# if we've come here we already verified the interface