Add forward-compatibility for storage type parameter

The Rust rewrite of vdirsyncer requires explicitly specifying what type
of "filesystem" storage is being used. These can be either
"filesystem/icalendar" or "filesystem/vcard".

Add forward-compatibility with this upcoming format, by allowing (but
ignoring) a slash and anything after it.

This makes configuration files that have been updated for the Rust
implementation compatible with the Python implementation.

Closes: https://github.com/pimutils/vdirsyncer/pull/1075
This commit is contained in:
Hugo Osvaldo Barrera 2023-06-26 13:37:19 +02:00
parent 7e5910a341
commit b9f749467c
2 changed files with 6 additions and 1 deletions

View file

@ -15,6 +15,10 @@ Version 0.19.2
- Improve the performance of ``SingleFileStorage``. :gh:`818`
- Properly document some caveats of the Google Contacts storage.
- Fix crash when using auth certs. :gh:`1033`
- The ``filesystem`` storage can be specified with ``type =
"filesystem/icalendar"`` or ``type = "filesystem/vcard"``. This has not
functional impact, and is merely for forward compatibility with the Rust
implementation of vdirsyncer.
Version 0.19.1
==============

View file

@ -110,7 +110,8 @@ async def repair_collection(
storage_name, collection = storage_name.split("/")
config = config.get_storage_args(storage_name)
storage_type = config["type"]
# If storage type has a slash, ignore it and anything after it.
storage_type = config["type"].split("/")[0]
if collection is not None:
cli_logger.info("Discovering collections (skipping cache).")