mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-20 13:15:52 +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))
|
||||
continue
|
||||
|
||||
try:
|
||||
props = response.findall('{DAV:}propstat/{DAV:}prop')
|
||||
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))
|
||||
props = response.findall('{DAV:}propstat/{DAV:}prop')
|
||||
if props is None:
|
||||
dav_logger.warning('Skipping {!r}, properties are missing.'
|
||||
.format(href))
|
||||
continue
|
||||
else:
|
||||
props = _merge_xml(props)
|
||||
|
||||
if props.find('{DAV:}resourcetype/{DAV:}collection') is not None:
|
||||
dav_logger.debug('Skipping {!r}, is collection.'.format(href))
|
||||
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'),
|
||||
'text', None)
|
||||
if not self._is_item_mimetype(contenttype):
|
||||
|
|
|
|||
Loading…
Reference in a new issue