Object searching method should not traceback for non-existant keys (#65553)
Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
This commit is contained in:
parent
531eebffa8
commit
63bb08fea8
1 changed files with 1 additions and 1 deletions
|
@ -597,7 +597,7 @@ def validate_config(spec, data):
|
||||||
|
|
||||||
def search_obj_in_list(name, lst, key='name'):
|
def search_obj_in_list(name, lst, key='name'):
|
||||||
for item in lst:
|
for item in lst:
|
||||||
if item[key] == name:
|
if item.get(key) == name:
|
||||||
return item
|
return item
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue