mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-19 15:16:33 +00:00
Fix wrong UTF-8 config files (#895)
* Fix wrong UTF-8 config files * Fix lint * Update data.py
This commit is contained in:
parent
27532a8a00
commit
9053341581
@ -99,9 +99,19 @@ class AddonsData(JsonConfig, CoreSysAttributes):
|
|||||||
try:
|
try:
|
||||||
addon_config = read_json_file(addon)
|
addon_config = read_json_file(addon)
|
||||||
|
|
||||||
|
except (OSError, json.JSONDecodeError, UnicodeDecodeError):
|
||||||
|
_LOGGER.warning("Can't read %s", addon)
|
||||||
|
continue
|
||||||
|
|
||||||
# validate
|
# validate
|
||||||
|
try:
|
||||||
addon_config = SCHEMA_ADDON_CONFIG(addon_config)
|
addon_config = SCHEMA_ADDON_CONFIG(addon_config)
|
||||||
|
|
||||||
|
except vol.Invalid as ex:
|
||||||
|
_LOGGER.warning("Can't read %s: %s", addon,
|
||||||
|
humanize_error(addon_config, ex))
|
||||||
|
continue
|
||||||
|
|
||||||
# Generate slug
|
# Generate slug
|
||||||
addon_slug = "{}_{}".format(
|
addon_slug = "{}_{}".format(
|
||||||
repository, addon_config[ATTR_SLUG])
|
repository, addon_config[ATTR_SLUG])
|
||||||
@ -111,13 +121,6 @@ class AddonsData(JsonConfig, CoreSysAttributes):
|
|||||||
addon_config[ATTR_LOCATON] = str(addon.parent)
|
addon_config[ATTR_LOCATON] = str(addon.parent)
|
||||||
self._cache[addon_slug] = addon_config
|
self._cache[addon_slug] = addon_config
|
||||||
|
|
||||||
except (OSError, json.JSONDecodeError):
|
|
||||||
_LOGGER.warning("Can't read %s", addon)
|
|
||||||
|
|
||||||
except vol.Invalid as ex:
|
|
||||||
_LOGGER.warning("Can't read %s: %s", addon,
|
|
||||||
humanize_error(addon_config, ex))
|
|
||||||
|
|
||||||
def _set_builtin_repositories(self):
|
def _set_builtin_repositories(self):
|
||||||
"""Add local built-in repository into dataset."""
|
"""Add local built-in repository into dataset."""
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user