solaar: handle exceptions processing configuration file
This commit is contained in:
parent
8a3cbc5378
commit
130aa20bb1
|
@ -134,6 +134,7 @@ def _convert_json(json_dict):
|
||||||
|
|
||||||
def _cleanup_load(c):
|
def _cleanup_load(c):
|
||||||
_config = [__version__]
|
_config = [__version__]
|
||||||
|
try:
|
||||||
for element in c:
|
for element in c:
|
||||||
if isinstance(element, dict):
|
if isinstance(element, dict):
|
||||||
divert = element.get('divert-keys')
|
divert = element.get('divert-keys')
|
||||||
|
@ -151,6 +152,8 @@ def _cleanup_load(c):
|
||||||
# convert to device entries
|
# convert to device entries
|
||||||
element = _DeviceEntry(**element)
|
element = _DeviceEntry(**element)
|
||||||
_config.append(element)
|
_config.append(element)
|
||||||
|
except Exception as e:
|
||||||
|
_log.warn('Exception processing config.yaml file, ignoring contents: %s', e)
|
||||||
return _config
|
return _config
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue