mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Loosen up validation for vdirs
Otherwise we would have breakage for vdirs where the href is not uid + fileext (which is the case with old watdo versions)
This commit is contained in:
parent
221968b787
commit
0fd07ec9de
1 changed files with 4 additions and 1 deletions
|
|
@ -11,6 +11,8 @@ import os
|
||||||
from vdirsyncer.storage.base import Storage, Item
|
from vdirsyncer.storage.base import Storage, Item
|
||||||
import vdirsyncer.exceptions as exceptions
|
import vdirsyncer.exceptions as exceptions
|
||||||
from vdirsyncer.utils import expand_path
|
from vdirsyncer.utils import expand_path
|
||||||
|
import vdirsyncer.log as log
|
||||||
|
logger = log.get('storage.filesystem')
|
||||||
|
|
||||||
|
|
||||||
class FilesystemStorage(Storage):
|
class FilesystemStorage(Storage):
|
||||||
|
|
@ -65,7 +67,8 @@ class FilesystemStorage(Storage):
|
||||||
def update(self, href, obj, etag):
|
def update(self, href, obj, etag):
|
||||||
fpath = self._get_filepath(href)
|
fpath = self._get_filepath(href)
|
||||||
if href != self._get_href(obj.uid):
|
if href != self._get_href(obj.uid):
|
||||||
raise exceptions.NotFoundError(obj.uid)
|
logger.warning('href != uid + fileext: href={}; uid={}'
|
||||||
|
.format(href, obj.uid))
|
||||||
if not os.path.exists(fpath):
|
if not os.path.exists(fpath):
|
||||||
raise exceptions.NotFoundError(obj.uid)
|
raise exceptions.NotFoundError(obj.uid)
|
||||||
actual_etag = os.path.getmtime(fpath)
|
actual_etag = os.path.getmtime(fpath)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue