summaryrefslogtreecommitdiff
path: root/python/vyos/util.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-09-06 12:02:56 +0200
committerChristian Poessinger <christian@poessinger.com>2021-09-06 12:14:35 +0200
commit407d814966d045783df01839e248a9489e19bf83 (patch)
treed4f0ff72ab27d0ca7c5596cfe4c6b1a22b636b0f /python/vyos/util.py
parentc14bb9ab38112837c3e1e0cafcb3b8f19cfba1c0 (diff)
downloadvyos-1x-407d814966d045783df01839e248a9489e19bf83.tar.gz
vyos-1x-407d814966d045783df01839e248a9489e19bf83.zip
vyos.util: T2755: rename dict_search() function args to match other implementations
(cherry picked from commit 9d0c37fbbc91acc9f2c0f2abaab360479e451f0f)
Diffstat (limited to 'python/vyos/util.py')
-rw-r--r--python/vyos/util.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/python/vyos/util.py b/python/vyos/util.py
index f3451fd77..45b1d7bf2 100644
--- a/python/vyos/util.py
+++ b/python/vyos/util.py
@@ -676,20 +676,20 @@ def find_device_file(device):
return None
-def dict_search(path, my_dict):
- """ Traverse Python dictionary (my_dict) delimited by dot (.).
+def dict_search(path, dict_object):
+ """ Traverse Python dictionary (dict_object) delimited by dot (.).
Return value of key if found, None otherwise.
- This is faster implementation then jmespath.search('foo.bar', my_dict)"""
- if not isinstance(my_dict, dict) or not path:
+ This is faster implementation then jmespath.search('foo.bar', dict_object)"""
+ if not isinstance(dict_object, dict) or not path:
return None
parts = path.split('.')
inside = parts[:-1]
if not inside:
- if path not in my_dict:
+ if path not in dict_object:
return None
- return my_dict[path]
- c = my_dict
+ return dict_object[path]
+ c = dict_object
for p in parts[:-1]:
c = c.get(p, {})
return c.get(parts[-1], None)