Browse Source

Fix regression in which the "transfer" action produced a traceback (#663).

Dan Helfman 2 năm trước cách đây
mục cha
commit
5f595f7ac3

+ 1 - 0
NEWS

@@ -1,5 +1,6 @@
 1.7.11.dev0
 1.7.11.dev0
  * #662: Fix regression in which "check_repositories" option failed to match repositories.
  * #662: Fix regression in which "check_repositories" option failed to match repositories.
+ * #663: Fix regression in which the "transfer" action produced a traceback.
 
 
 1.7.10
 1.7.10
  * #396: When a database command errors, display and log the error message instead of swallowing it.
  * #396: When a database command errors, display and log the error message instead of swallowing it.

+ 2 - 2
borgmatic/actions/transfer.py

@@ -17,10 +17,10 @@ def run_transfer(
     '''
     '''
     Run the "transfer" action for the given repository.
     Run the "transfer" action for the given repository.
     '''
     '''
-    logger.info(f'{repository}: Transferring archives to repository')
+    logger.info(f'{repository["path"]}: Transferring archives to repository')
     borgmatic.borg.transfer.transfer_archives(
     borgmatic.borg.transfer.transfer_archives(
         global_arguments.dry_run,
         global_arguments.dry_run,
-        repository,
+        repository['path'],
         storage,
         storage,
         local_borg_version,
         local_borg_version,
         transfer_arguments,
         transfer_arguments,

+ 1 - 1
tests/unit/actions/test_transfer.py

@@ -10,7 +10,7 @@ def test_run_transfer_does_not_raise():
     global_arguments = flexmock(monitoring_verbosity=1, dry_run=False)
     global_arguments = flexmock(monitoring_verbosity=1, dry_run=False)
 
 
     module.run_transfer(
     module.run_transfer(
-        repository='repo',
+        repository={'path': 'repo'},
         storage={},
         storage={},
         local_borg_version=None,
         local_borg_version=None,
         transfer_arguments=transfer_arguments,
         transfer_arguments=transfer_arguments,