mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-26 02:26:30 +00:00
Use new format for logging exceptions - resolution/module.py (#3207)
This commit is contained in:
parent
73832dd6d6
commit
7abe9487a0
@ -176,8 +176,9 @@ class ResolutionManager(FileConfiguration, CoreSysAttributes):
|
|||||||
async def apply_suggestion(self, suggestion: Suggestion) -> None:
|
async def apply_suggestion(self, suggestion: Suggestion) -> None:
|
||||||
"""Apply suggested action."""
|
"""Apply suggested action."""
|
||||||
if suggestion not in self._suggestions:
|
if suggestion not in self._suggestions:
|
||||||
_LOGGER.warning("Suggestion %s is not valid", suggestion.uuid)
|
raise ResolutionError(
|
||||||
raise ResolutionError()
|
f"Suggestion {suggestion.uuid} is not valid", _LOGGER.warning
|
||||||
|
)
|
||||||
|
|
||||||
await self.fixup.apply_fixup(suggestion)
|
await self.fixup.apply_fixup(suggestion)
|
||||||
await self.healthcheck()
|
await self.healthcheck()
|
||||||
@ -185,20 +186,21 @@ class ResolutionManager(FileConfiguration, CoreSysAttributes):
|
|||||||
def dismiss_suggestion(self, suggestion: Suggestion) -> None:
|
def dismiss_suggestion(self, suggestion: Suggestion) -> None:
|
||||||
"""Dismiss suggested action."""
|
"""Dismiss suggested action."""
|
||||||
if suggestion not in self._suggestions:
|
if suggestion not in self._suggestions:
|
||||||
_LOGGER.warning("The UUID %s is not valid suggestion", suggestion.uuid)
|
raise ResolutionError(
|
||||||
raise ResolutionError()
|
f"The UUID {suggestion.uuid} is not valid suggestion", _LOGGER.warning
|
||||||
|
)
|
||||||
self._suggestions.remove(suggestion)
|
self._suggestions.remove(suggestion)
|
||||||
|
|
||||||
def dismiss_issue(self, issue: Issue) -> None:
|
def dismiss_issue(self, issue: Issue) -> None:
|
||||||
"""Dismiss suggested action."""
|
"""Dismiss suggested action."""
|
||||||
if issue not in self._issues:
|
if issue not in self._issues:
|
||||||
_LOGGER.warning("The UUID %s is not a valid issue", issue.uuid)
|
raise ResolutionError(
|
||||||
raise ResolutionError()
|
f"The UUID {issue.uuid} is not a valid issue", _LOGGER.warning
|
||||||
|
)
|
||||||
self._issues.remove(issue)
|
self._issues.remove(issue)
|
||||||
|
|
||||||
def dismiss_unsupported(self, reason: Issue) -> None:
|
def dismiss_unsupported(self, reason: Issue) -> None:
|
||||||
"""Dismiss a reason for unsupported."""
|
"""Dismiss a reason for unsupported."""
|
||||||
if reason not in self._unsupported:
|
if reason not in self._unsupported:
|
||||||
_LOGGER.warning("The reason %s is not active", reason)
|
raise ResolutionError(f"The reason {reason} is not active", _LOGGER.warning)
|
||||||
raise ResolutionError()
|
|
||||||
self._unsupported.remove(reason)
|
self._unsupported.remove(reason)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user