Skip to content

Commit

Permalink
Always include SSL folder in backups (#136080)
Browse files Browse the repository at this point in the history
  • Loading branch information
emontnemery authored and frenck committed Jan 20, 2025
1 parent 92b786e commit 3c534a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions homeassistant/components/hassio/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,12 @@ async def async_create_backup(
include_addons_set = supervisor_backups.AddonSet.ALL
elif include_addons:
include_addons_set = set(include_addons)
include_folders_set = (
{supervisor_backups.Folder(folder) for folder in include_folders}
if include_folders
else None
)
include_folders_set = {
supervisor_backups.Folder(folder) for folder in include_folders or []
}
# Always include SSL if Home Assistant is included
if include_homeassistant:
include_folders_set.add(supervisor_backups.Folder.SSL)

hassio_agents: list[SupervisorBackupAgent] = [
cast(SupervisorBackupAgent, manager.backup_agents[agent_id])
Expand Down
4 changes: 2 additions & 2 deletions tests/components/hassio/test_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ async def test_agents_notify_on_mount_added_removed(
"instance_id": ANY,
"with_automatic_settings": False,
},
folders=None,
folders={"ssl"},
homeassistant_exclude_database=False,
homeassistant=True,
location=[None],
Expand Down Expand Up @@ -704,7 +704,7 @@ async def test_agents_notify_on_mount_added_removed(
),
(
{"include_folders": ["media", "share"]},
replace(DEFAULT_BACKUP_OPTIONS, folders={"media", "share"}),
replace(DEFAULT_BACKUP_OPTIONS, folders={"media", "share", "ssl"}),
),
(
{
Expand Down

0 comments on commit 3c534a7

Please sign in to comment.