mirror of
https://github.com/home-assistant/core.git
synced 2025-08-13 17:45:19 +02:00
Avoid string manipulations in hassio backup reader/writer (#133339)
This commit is contained in:
@@ -175,7 +175,7 @@ class SupervisorBackupReaderWriter(BackupReaderWriter):
|
|||||||
hassio_agents: list[SupervisorBackupAgent] = [
|
hassio_agents: list[SupervisorBackupAgent] = [
|
||||||
cast(SupervisorBackupAgent, manager.backup_agents[agent_id])
|
cast(SupervisorBackupAgent, manager.backup_agents[agent_id])
|
||||||
for agent_id in agent_ids
|
for agent_id in agent_ids
|
||||||
if agent_id.startswith(DOMAIN)
|
if manager.backup_agents[agent_id].domain == DOMAIN
|
||||||
]
|
]
|
||||||
locations = {agent.location for agent in hassio_agents}
|
locations = {agent.location for agent in hassio_agents}
|
||||||
|
|
||||||
@@ -254,7 +254,7 @@ class SupervisorBackupReaderWriter(BackupReaderWriter):
|
|||||||
hassio_agents: list[SupervisorBackupAgent] = [
|
hassio_agents: list[SupervisorBackupAgent] = [
|
||||||
cast(SupervisorBackupAgent, manager.backup_agents[agent_id])
|
cast(SupervisorBackupAgent, manager.backup_agents[agent_id])
|
||||||
for agent_id in agent_ids
|
for agent_id in agent_ids
|
||||||
if agent_id.startswith(DOMAIN)
|
if manager.backup_agents[agent_id].domain == DOMAIN
|
||||||
]
|
]
|
||||||
locations = {agent.location for agent in hassio_agents}
|
locations = {agent.location for agent in hassio_agents}
|
||||||
|
|
||||||
@@ -305,7 +305,8 @@ class SupervisorBackupReaderWriter(BackupReaderWriter):
|
|||||||
else None
|
else None
|
||||||
)
|
)
|
||||||
|
|
||||||
if not agent_id.startswith(DOMAIN):
|
manager = self._hass.data[DATA_MANAGER]
|
||||||
|
if manager.backup_agents[agent_id].domain != DOMAIN:
|
||||||
# Download the backup to the supervisor. Supervisor will clean up the backup
|
# Download the backup to the supervisor. Supervisor will clean up the backup
|
||||||
# two days after the restore is done.
|
# two days after the restore is done.
|
||||||
await self.async_receive_backup(
|
await self.async_receive_backup(
|
||||||
|
Reference in New Issue
Block a user