mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-20 15:46:29 +00:00
Use single quotes in f-strings (#5267)
Instead of using double quotes in f-strings use single quotes. This works with Python 3.11 too. We don't use Python 3.11 anymore, but is useful when running pytest on Debian bookworm natively, which comes with Python 3.11.
This commit is contained in:
parent
695a23a454
commit
2a0312318d
@ -358,7 +358,7 @@ class HomeAssistant(FileConfiguration, CoreSysAttributes):
|
||||
|
||||
if resp and not resp.get(ATTR_SUCCESS):
|
||||
raise HomeAssistantBackupError(
|
||||
f"Preparing backup of Home Assistant Core failed due to: {resp.get(ATTR_ERROR, {}).get(ATTR_MESSAGE, "")}. Check HA Core logs.",
|
||||
f"Preparing backup of Home Assistant Core failed due to: {resp.get(ATTR_ERROR, {}).get(ATTR_MESSAGE, '')}. Check HA Core logs.",
|
||||
_LOGGER.error,
|
||||
)
|
||||
|
||||
|
@ -51,12 +51,12 @@ def journal_verbose_formatter(entries: dict[str, str]) -> str:
|
||||
ts = ts[: ts.index(".") + 4] # strip TZ offset
|
||||
|
||||
identifier = (
|
||||
f"{entries.get("SYSLOG_IDENTIFIER", "_UNKNOWN_")}[{entries["_PID"]}]"
|
||||
f"{entries.get('SYSLOG_IDENTIFIER', '_UNKNOWN_')}[{entries['_PID']}]"
|
||||
if "_PID" in entries
|
||||
else entries.get("SYSLOG_IDENTIFIER", "_UNKNOWN_")
|
||||
)
|
||||
|
||||
return f"{ts} {entries.get("_HOSTNAME", "")} {identifier}: {entries.get("MESSAGE", "")}"
|
||||
return f"{ts} {entries.get('_HOSTNAME', '')} {identifier}: {entries.get('MESSAGE', '')}"
|
||||
|
||||
|
||||
async def journal_logs_reader(
|
||||
|
Loading…
x
Reference in New Issue
Block a user