Added an option to disable check in case WebDAV server is not support it

This commit is contained in:
Evgeny Ezhov 2019-11-27 16:15:21 +03:00
parent 64bbd967bc
commit dc7d908462
3 changed files with 6 additions and 3 deletions

View file

@ -34,6 +34,7 @@ Release Notes
* Added Docker Web DAV for CI
* Changed HEAD to GET method for 'check' request due of not all servers support HEAD by request of https://github.com/danieleTrimarchi
* Removed a costy is_dir-check on obvious directories to speed up a pull by https://github.com/jolly-jump
* Added an option to disable check in case WebDAV server is not support it by request of https://github.com/dzhuang
**Version 0.12 - 21.06.2019**
* Added depth argument in copy method in client.py by https://github.com/JesperHakansson

View file

@ -274,11 +274,13 @@ class Client(object):
:return: True if resource is exist or False otherwise
"""
if not self.webdav.do_check:
if self.webdav.disable_check:
return True
urn = Urn(remote_path)
try:
response = self.execute_request(action='check', path=urn.quote())
except RemoteResourceNotFound:
return False
except ResponseErrorCode:
return False

View file

@ -22,7 +22,7 @@ class WebDAVSettings(ConnectionSettings):
ns = "webdav:"
prefix = "webdav_"
keys = {'hostname', 'login', 'password', 'token', 'root', 'cert_path', 'key_path', 'recv_speed', 'send_speed',
'verbose', 'do_check'}
'verbose', 'disable_check'}
hostname = None
login = None
@ -34,7 +34,7 @@ class WebDAVSettings(ConnectionSettings):
recv_speed = None
send_speed = None
verbose = None
do_check = False
disable_check = False
def __init__(self, options):