webdav: consider path to be root

Remove _strip_protocol, moves to get_cloud_fs loading stage.
This commit is contained in:
Saugat Pachhai (सौगात)
2022-03-31 17:35:23 +03:00
committed by Ruslan Kuprieiev
parent b58ebff5db
commit 067442f348
2 changed files with 7 additions and 9 deletions
+6 -1
View File
@@ -114,7 +114,12 @@ def get_cloud_fs(repo, **kwargs):
remote_conf["gdrive_credentials_tmp_dir"] = repo.tmp_dir
url = remote_conf.pop("url")
fs_path = cls._strip_protocol(url) # pylint:disable=protected-access
if issubclass(cls, WebDAVFileSystem):
# For WebDAVFileSystem, provided url is the base path itself, so it
# should be treated as being a root path.
fs_path = cls.root_marker
else:
fs_path = cls._strip_protocol(url) # pylint:disable=protected-access
extras = cls._get_kwargs_from_urls(url) # pylint:disable=protected-access
conf = {**extras, **remote_conf} # remote config takes priority
+1 -8
View File
@@ -13,6 +13,7 @@ logger = logging.getLogger(__name__)
class WebDAVFileSystem(FSSpecWrapper): # pylint:disable=abstract-method
scheme = Schemes.WEBDAV
root_marker = ""
CAN_TRAVERSE = True
TRAVERSE_PREFIX_LEN = 2
REQUIRES = {"webdav4": "webdav4"}
@@ -33,14 +34,6 @@ class WebDAVFileSystem(FSSpecWrapper): # pylint:disable=abstract-method
}
)
@classmethod
def _strip_protocol(cls, path: str) -> str:
"""
For WebDAVFileSystem, provided url is the base path itself, so it
should be treated as being a root path.
"""
return ""
def unstrip_protocol(self, path: str) -> str:
return self.fs_args["base_url"] + "/" + path