Object searching method should not traceback for non-existant keys (#65553)

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
This commit is contained in:
Nilashish Chakraborty 2019-12-06 17:56:39 +05:30 committed by GitHub
parent 531eebffa8
commit 63bb08fea8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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