diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-08-23 14:22:41 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-08-23 14:22:41 +0200 |
commit | aa25690c83c4812c92490d29b564dd0330b24d34 (patch) | |
tree | 15c5f45b5f82fd5b788c842caeba06d3d81d96f9 /python/vyos/configdict.py | |
parent | 20ef1aab793504cf4956dedeeadaf528933b7ccf (diff) | |
download | vyos-1x-aa25690c83c4812c92490d29b564dd0330b24d34.tar.gz vyos-1x-aa25690c83c4812c92490d29b564dd0330b24d34.zip |
T2755: convert jmespath.search() to vyos_dict_search() for performance
Diffstat (limited to 'python/vyos/configdict.py')
-rw-r--r-- | python/vyos/configdict.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index c1e93955e..bd8624ced 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -17,7 +17,6 @@ A library for retrieving value dicts from VyOS configs in a declarative fashion. """ import os -import jmespath from enum import Enum from copy import deepcopy @@ -226,8 +225,9 @@ def get_interface_dict(config, base, ifname=''): Will return a dictionary with the necessary interface configuration """ - from vyos.xml import defaults + from vyos.util import vyos_dict_search from vyos.validate import is_member + from vyos.xml import defaults if not ifname: # determine tagNode instance @@ -273,7 +273,7 @@ def get_interface_dict(config, base, ifname=''): # XXX: T2636 workaround: convert string to a list with one element if isinstance(eui64, str): eui64 = [eui64] - tmp = jmespath.search('ipv6.address', dict) + tmp = vyos_dict_search('ipv6.address', dict) if not tmp: dict.update({'ipv6': {'address': {'eui64_old': eui64}}}) else: |