mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-26 18:46:29 +00:00
Use new format for logging exceptions - addons/init.py (#3179)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
This commit is contained in:
parent
df6b815175
commit
af628293f3
@ -306,22 +306,24 @@ class AddonManager(CoreSysAttributes):
|
|||||||
async def rebuild(self, slug: str) -> None:
|
async def rebuild(self, slug: str) -> None:
|
||||||
"""Perform a rebuild of local build add-on."""
|
"""Perform a rebuild of local build add-on."""
|
||||||
if slug not in self.local:
|
if slug not in self.local:
|
||||||
_LOGGER.error("Add-on %s is not installed", slug)
|
raise AddonsError(f"Add-on {slug} is not installed", _LOGGER.error)
|
||||||
raise AddonsError()
|
|
||||||
addon = self.local[slug]
|
addon = self.local[slug]
|
||||||
|
|
||||||
if addon.is_detached:
|
if addon.is_detached:
|
||||||
_LOGGER.error("Add-on %s is not available inside store", slug)
|
raise AddonsError(
|
||||||
raise AddonsError()
|
f"Add-on {slug} is not available inside store", _LOGGER.error
|
||||||
|
)
|
||||||
store = self.store[slug]
|
store = self.store[slug]
|
||||||
|
|
||||||
# Check if a rebuild is possible now
|
# Check if a rebuild is possible now
|
||||||
if addon.version != store.version:
|
if addon.version != store.version:
|
||||||
_LOGGER.error("Version changed, use Update instead Rebuild")
|
raise AddonsError(
|
||||||
raise AddonsError()
|
"Version changed, use Update instead Rebuild", _LOGGER.error
|
||||||
|
)
|
||||||
if not addon.need_build:
|
if not addon.need_build:
|
||||||
_LOGGER.error("Can't rebuild a image based add-on")
|
raise AddonsNotSupportedError(
|
||||||
raise AddonsNotSupportedError()
|
"Can't rebuild a image based add-on", _LOGGER.error
|
||||||
|
)
|
||||||
|
|
||||||
# remove docker container but not addon config
|
# remove docker container but not addon config
|
||||||
last_state: AddonState = addon.state
|
last_state: AddonState = addon.state
|
||||||
|
Loading…
x
Reference in New Issue
Block a user