Fix backup remove for alternate locations (#5515)

Currently the API converts backup locations on network mounts to
the Supervisor's Mount representation. However, the locations stored
in the backup representations is a dictionary with the location
string as key.

Make sure to use the backup location string to validate the remove
requests. This fixes removing backups from network storage mounts.
This commit is contained in:
Stefan Agner 2024-12-30 14:18:11 +01:00 committed by GitHub
parent dbd37d6575
commit 578383411c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -263,9 +263,10 @@ class BackupManager(FileConfiguration, JobGroup):
"""Remove a backup."""
targets = (
[
self._get_location_name(location)
location_name
for location in locations
if location in backup.all_locations
if (location_name := self._get_location_name(location))
in backup.all_locations
]
if locations
else list(backup.all_locations.keys())