mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
fs.webdav: consider url/path to be root
Webdav filesystem expects path to be relative to the base url, instead of having full prefix. So we are setting it to "" (root) through `_strip_protocol` which converts fully-qualified name to the file-system specific path.
This commit is contained in:
committed by
Ruslan Kuprieiev
parent
c08aa4a93b
commit
b92bc3e01a
+5
-3
@@ -35,9 +35,11 @@ class WebDAVFileSystem(FSSpecWrapper): # pylint:disable=abstract-method
|
||||
|
||||
@classmethod
|
||||
def _strip_protocol(cls, path: str) -> str:
|
||||
from fsspec.utils import infer_storage_options
|
||||
|
||||
return infer_storage_options(path)["path"].lstrip("/")
|
||||
"""
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user