From 068442737342027a17ac2aacd6c8f746358c50a6 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sun, 8 Apr 2018 23:30:42 +0200 Subject: [PATCH] Bugfix, remove unsupported characters --- hassio/addons/build.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hassio/addons/build.py b/hassio/addons/build.py index a3dcfb5b3..d98c9597a 100644 --- a/hassio/addons/build.py +++ b/hassio/addons/build.py @@ -55,8 +55,8 @@ class AddonBuild(JsonConfig, CoreSysAttributes): 'io.hass.version': version, 'io.hass.arch': self._arch, 'io.hass.type': META_ADDON, - 'io.hass.name': self.addon.name, - 'io.hass.description': self.addon.description, + 'io.hass.name': self._fix_label('name'), + 'io.hass.description': self._fix_label('description'), }, 'buildargs': { 'BUILD_FROM': self.base_image, @@ -70,3 +70,8 @@ class AddonBuild(JsonConfig, CoreSysAttributes): args['labels']['io.hass.url'] = self.addon.url return args + + def _fix_label(self, label_name): + """Remove characters they are not supported.""" + label = getattr(self.addon, label_name, "") + return label.replace("'", "")