Browse Source

Adjust for Borg 2's change from "rclone://" repository URLs to just "rclone:".

Dan Helfman 7 months ago
parent
commit
fe0fe27c36
3 changed files with 5 additions and 7 deletions
  1. 1 1
      NEWS
  2. 2 4
      borgmatic/config/normalize.py
  3. 2 2
      tests/unit/config/test_normalize.py

+ 1 - 1
NEWS

@@ -19,7 +19,7 @@
  * #911: Add a "key change-passphrase" action to change the passphrase protecting a repository key.
  * #921: BREAKING: Change soft failure command hooks to skip only the current repository rather than
    all repositories in the configuration file.
- * Add support for Borg 2's "rclone://" repository URLs, so you can backup to 70+ cloud storage
+ * Add support for Borg 2's "rclone:" repository URLs, so you can backup to 70+ cloud storage
    services whether or not they support Borg explicitly.
  * When using Borg 2, default the "archive_name_format" option to just "{hostname}", as Borg 2 does
    not require unique archive names; identical archive names form a common "series" that can be

+ 2 - 4
borgmatic/config/normalize.py

@@ -233,9 +233,7 @@ def normalize(config_filename, config):
                             path=updated_repository_path,
                         )
                     )
-                elif repository_path.startswith('ssh://') or repository_path.startswith(
-                    'rclone://'
-                ):
+                elif repository_path.startswith('ssh://') or repository_path.startswith('rclone:'):
                     config['repositories'].append(repository_dict)
                 else:
                     rewritten_repository_path = f"ssh://{repository_path.replace(':~', '/~').replace(':/', '/').replace(':', '/./')}"
@@ -244,7 +242,7 @@ def normalize(config_filename, config):
                             dict(
                                 levelno=logging.WARNING,
                                 levelname='WARNING',
-                                msg=f'{config_filename}: Remote repository paths without ssh:// or rclone:// syntax are deprecated and support will be removed from a future release. Interpreting "{repository_path}" as "{rewritten_repository_path}"',
+                                msg=f'{config_filename}: Remote repository paths without ssh:// or rclone: syntax are deprecated and support will be removed from a future release. Interpreting "{repository_path}" as "{rewritten_repository_path}"',
                             )
                         )
                     )

+ 2 - 2
tests/unit/config/test_normalize.py

@@ -212,8 +212,8 @@ def test_normalize_sections_with_only_scalar_raises():
             True,
         ),
         (
-            {'repositories': ['rclone://host:/repo']},
-            {'repositories': [{'path': 'rclone://host:/repo'}]},
+            {'repositories': ['rclone:host:repo']},
+            {'repositories': [{'path': 'rclone:host:repo'}]},
             True,
         ),
         (