From aa25690c83c4812c92490d29b564dd0330b24d34 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 23 Aug 2020 14:22:41 +0200 Subject: T2755: convert jmespath.search() to vyos_dict_search() for performance --- python/vyos/ifconfig/ethernet.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'python/vyos/ifconfig/ethernet.py') diff --git a/python/vyos/ifconfig/ethernet.py b/python/vyos/ifconfig/ethernet.py index b2f701e00..17c1bd64d 100644 --- a/python/vyos/ifconfig/ethernet.py +++ b/python/vyos/ifconfig/ethernet.py @@ -15,12 +15,12 @@ import os import re -import jmespath from vyos.ifconfig.interface import Interface from vyos.ifconfig.vlan import VLAN from vyos.validate import assert_list from vyos.util import run +from vyos.util import vyos_dict_search @Interface.register @VLAN.enable @@ -268,27 +268,27 @@ class EthernetIf(Interface): self.set_flow_control(value) # GRO (generic receive offload) - tmp = jmespath.search('offload_options.generic_receive', config) + tmp = vyos_dict_search('offload_options.generic_receive', config) value = tmp if (tmp != None) else 'off' self.set_gro(value) # GSO (generic segmentation offload) - tmp = jmespath.search('offload_options.generic_segmentation', config) + tmp = vyos_dict_search('offload_options.generic_segmentation', config) value = tmp if (tmp != None) else 'off' self.set_gso(value) # scatter-gather option - tmp = jmespath.search('offload_options.scatter_gather', config) + tmp = vyos_dict_search('offload_options.scatter_gather', config) value = tmp if (tmp != None) else 'off' self.set_sg(value) # TSO (TCP segmentation offloading) - tmp = jmespath.search('offload_options.udp_fragmentation', config) + tmp = vyos_dict_search('offload_options.udp_fragmentation', config) value = tmp if (tmp != None) else 'off' self.set_tso(value) # UDP fragmentation offloading - tmp = jmespath.search('offload_options.udp_fragmentation', config) + tmp = vyos_dict_search('offload_options.udp_fragmentation', config) value = tmp if (tmp != None) else 'off' self.set_ufo(value) -- cgit v1.2.3