mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Bugfix in config validator
This commit is contained in:
parent
a5eec6193b
commit
d33c98ac93
1 changed files with 11 additions and 5 deletions
|
|
@ -7,6 +7,7 @@ from click_threading import get_ui_worker
|
||||||
|
|
||||||
from . import cli_logger
|
from . import cli_logger
|
||||||
from .fetchparams import expand_fetch_params
|
from .fetchparams import expand_fetch_params
|
||||||
|
from .utils import storage_class_from_config
|
||||||
from .. import PROJECT_HOME, exceptions
|
from .. import PROJECT_HOME, exceptions
|
||||||
from ..utils import expand_path
|
from ..utils import expand_path
|
||||||
|
|
||||||
|
|
@ -287,11 +288,16 @@ class PairConfig(object):
|
||||||
|
|
||||||
def _set_partial_sync(self, options):
|
def _set_partial_sync(self, options):
|
||||||
partial_sync = options.pop('partial_sync', None)
|
partial_sync = options.pop('partial_sync', None)
|
||||||
if partial_sync is not None and \
|
if partial_sync is not None:
|
||||||
not self.config_a.get('read_only', False) and \
|
cls_a, _ = storage_class_from_config(self.config_a)
|
||||||
not self.config_b.get('read_only', False):
|
cls_b, _ = storage_class_from_config(self.config_b)
|
||||||
raise ValueError('`partial_sync` is only effective if one storage '
|
|
||||||
'is read-only.')
|
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:
|
if partial_sync is None:
|
||||||
partial_sync = 'revert'
|
partial_sync = 'revert'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue