solaar: handle exceptions processing configuration file

This commit is contained in:
Peter F. Patel-Schneider 2022-10-11 05:54:36 -04:00
parent 8a3cbc5378
commit 130aa20bb1
1 changed files with 20 additions and 17 deletions

View File

@ -134,6 +134,7 @@ def _convert_json(json_dict):
def _cleanup_load(c):
_config = [__version__]
try:
for element in c:
if isinstance(element, dict):
divert = element.get('divert-keys')
@ -151,6 +152,8 @@ def _cleanup_load(c):
# convert to device entries
element = _DeviceEntry(**element)
_config.append(element)
except Exception as e:
_log.warn('Exception processing config.yaml file, ignoring contents: %s', e)
return _config