1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-24 20:35:55 +00:00

Check if a option is missing inside nested lists (#216)

* Update validate.py

* fix lint
This commit is contained in:
Pascal Vizeli
2017-10-09 14:08:29 +02:00
committed by GitHub
parent 2df4f80aa5
commit 8a11e6c845

View File

@@ -256,6 +256,13 @@ def _nested_validate_list(typ, data_list, key):
continue
c_options[c_key] = _single_validate(typ[c_key], c_value, c_key)
# check if all options are exists
missing = set(typ) - set(c_options)
if missing:
raise vol.Invalid(
"Missing {} options inside nested list".format(missing))
options.append(c_options)
# normal list
else: