diff --git a/vdirsyncer/cli/config.py b/vdirsyncer/cli/config.py index 9a909b2..3a95645 100644 --- a/vdirsyncer/cli/config.py +++ b/vdirsyncer/cli/config.py @@ -7,6 +7,7 @@ from click_threading import get_ui_worker from . import cli_logger from .fetchparams import expand_fetch_params +from .utils import storage_class_from_config from .. import PROJECT_HOME, exceptions from ..utils import expand_path @@ -287,11 +288,16 @@ class PairConfig(object): def _set_partial_sync(self, options): partial_sync = options.pop('partial_sync', None) - if partial_sync is not None and \ - not self.config_a.get('read_only', False) and \ - not self.config_b.get('read_only', False): - raise ValueError('`partial_sync` is only effective if one storage ' - 'is read-only.') + if partial_sync is not None: + cls_a, _ = storage_class_from_config(self.config_a) + cls_b, _ = storage_class_from_config(self.config_b) + + if not cls_a.read_only and \ + not self.config_a.get('read_only', False) and \ + not cls_b.read_only and \ + not self.config_b.get('read_only', False): + raise ValueError('`partial_sync` is only effective if one ' + 'storage is read-only.') if partial_sync is None: partial_sync = 'revert'