From 89eda9e068870c3b33ad6d9368090bac5a0bd511 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Tue, 17 Dec 2024 17:47:17 +0100 Subject: [PATCH] Don't raise when removing non-existing cloud backup (#133429) --- homeassistant/components/cloud/backup.py | 2 +- tests/components/cloud/test_backup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/cloud/backup.py b/homeassistant/components/cloud/backup.py index d394daa7dc5..e826c229321 100644 --- a/homeassistant/components/cloud/backup.py +++ b/homeassistant/components/cloud/backup.py @@ -167,7 +167,7 @@ class CloudBackupAgent(BackupAgent): :param backup_id: The ID of the backup that was returned in async_list_backups. """ if not await self.async_get_backup(backup_id): - raise BackupAgentError("Backup not found") + return try: await async_files_delete_file( diff --git a/tests/components/cloud/test_backup.py b/tests/components/cloud/test_backup.py index ac0ef1826de..5e607bbc70b 100644 --- a/tests/components/cloud/test_backup.py +++ b/tests/components/cloud/test_backup.py @@ -570,4 +570,4 @@ async def test_agents_delete_not_found( response = await client.receive_json() assert response["success"] - assert response["result"] == {"agent_errors": {"cloud.cloud": "Backup not found"}} + assert response["result"] == {"agent_errors": {}}