Skip to content

Commit 9f6d9e6

Browse files
committed
revert unneessary change to import
1 parent c4662c3 commit 9f6d9e6

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

supervisor/backups/manager.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import errno
88
import logging
99
from pathlib import Path
10-
import shutil
10+
from shutil import copy
1111

1212
from ..addons.addon import Addon
1313
from ..const import (
@@ -377,9 +377,7 @@ def copy_to_additional_locations() -> dict[str | None, Path]:
377377
try:
378378
if location == LOCATION_CLOUD_BACKUP:
379379
all_new_locations[LOCATION_CLOUD_BACKUP] = Path(
380-
shutil.copy(
381-
backup.tarfile, self.sys_config.path_core_backup
382-
)
380+
copy(backup.tarfile, self.sys_config.path_core_backup)
383381
)
384382
elif location:
385383
location_mount: Mount = location
@@ -389,11 +387,11 @@ def copy_to_additional_locations() -> dict[str | None, Path]:
389387
_LOGGER.error,
390388
)
391389
all_new_locations[location_mount.name] = Path(
392-
shutil.copy(backup.tarfile, location_mount.local_where)
390+
copy(backup.tarfile, location_mount.local_where)
393391
)
394392
else:
395393
all_new_locations[None] = Path(
396-
shutil.copy(backup.tarfile, self.sys_config.path_backup)
394+
copy(backup.tarfile, self.sys_config.path_backup)
397395
)
398396
except OSError as err:
399397
msg = f"Could not copy backup to {location.name if isinstance(location, Mount) else location} due to: {err!s}"

tests/api/test_backups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ async def test_backup_to_multiple_locations_error_on_copy(
686686
await coresys.core.set_state(CoreState.RUNNING)
687687
coresys.hardware.disk.get_disk_free_space = lambda x: 5000
688688

689-
with patch("supervisor.backups.manager.shutil.copy", side_effect=OSError):
689+
with patch("supervisor.backups.manager.copy", side_effect=OSError):
690690
resp = await api_client.post(
691691
f"/backups/new/{backup_type}",
692692
json={

0 commit comments

Comments
 (0)