`vyos.util.vyos_dict_search(path, dict)` is a lightweight alternative to `jmespath.search()` which will traverse a dictionary given on a dot separated path.
### KeyError
If we only supply `path = 'foo' ` and 'foo' is not a key within the passed dict a KeyError will be generated:
```
>>> data = {}
>>> vyos_dict_search('foo', data)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/vyos/util.py", line 685, in vyos_dict_search
return dict[path]
KeyError: 'foo'
```
This is most likely not what we have intended for the use of `vyos_dict_search()`, we rather would see retunring it `None` or `[]` - which is yet to be decided.
### On key existence return True or value
On the other hand, when we are interested if a key is present (or not) we should rather return `True`, or its value instead of `{}`
```
>>> data = {'foo': {'bar':{}}}
>>> vyos_dict_search('foo', data)
{'bar': {}}
>>> vyos_dict_search('foo.bar', data)
{}
```
A value of `True` is expected, thus we can use `if vyos_config_dict(path, dict):` statements in out codebase
### Return empty list [] over None on non-existing keys
When we transition from using None as the return value for non existing keys in a dict and rather use [] we can directly use the statement in `if` and `for` expressions
```
if not vyos_config_dict(path, dict):
print("VyOS")
```
```
for item in vyos_config_dict(path, dict):
print(item)
```
As of now we must write:
```
for item in (vyos_config_dict(path, dict) or []):
print(item)
```
### Add Unittests to vyos-1x builds
As this is a crucial part of the internal API, UnitTests must be supplied.