mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Skip collections first
This avoids FUD errors later when trying to access e.g. etags for it.
This commit is contained in:
parent
863d574261
commit
742109f542
1 changed files with 9 additions and 11 deletions
|
|
@ -478,25 +478,23 @@ class DavStorage(Storage):
|
||||||
.format(href))
|
.format(href))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
try:
|
props = response.findall('{DAV:}propstat/{DAV:}prop')
|
||||||
props = response.findall('{DAV:}propstat/{DAV:}prop')
|
if props is None:
|
||||||
if props is None:
|
|
||||||
raise InvalidXMLResponse()
|
|
||||||
props = _merge_xml(props)
|
|
||||||
|
|
||||||
etag = getattr(props.find('{DAV:}getetag'), 'text', '')
|
|
||||||
if not etag:
|
|
||||||
raise InvalidXMLResponse('Etag is missing.')
|
|
||||||
except InvalidXMLResponse as e:
|
|
||||||
dav_logger.error(str(e))
|
|
||||||
dav_logger.warning('Skipping {!r}, properties are missing.'
|
dav_logger.warning('Skipping {!r}, properties are missing.'
|
||||||
.format(href))
|
.format(href))
|
||||||
continue
|
continue
|
||||||
|
else:
|
||||||
|
props = _merge_xml(props)
|
||||||
|
|
||||||
if props.find('{DAV:}resourcetype/{DAV:}collection') is not None:
|
if props.find('{DAV:}resourcetype/{DAV:}collection') is not None:
|
||||||
dav_logger.debug('Skipping {!r}, is collection.'.format(href))
|
dav_logger.debug('Skipping {!r}, is collection.'.format(href))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
etag = getattr(props.find('{DAV:}getetag'), 'text', '')
|
||||||
|
if not etag:
|
||||||
|
dav_logger.warning('Skipping {!r}, etag property is missing.'
|
||||||
|
.format(href))
|
||||||
|
|
||||||
contenttype = getattr(props.find('{DAV:}getcontenttype'),
|
contenttype = getattr(props.find('{DAV:}getcontenttype'),
|
||||||
'text', None)
|
'text', None)
|
||||||
if not self._is_item_mimetype(contenttype):
|
if not self._is_item_mimetype(contenttype):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue