File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 77import errno
88import logging
99from pathlib import Path
10- import shutil
10+ from shutil import copy
1111
1212from ..addons .addon import Addon
1313from ..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} "
Original file line number Diff line number Diff 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 = {
You can’t perform that action at this time.
0 commit comments