mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
webdav: consider path to be root
Remove _strip_protocol, moves to get_cloud_fs loading stage.
This commit is contained in:
committed by
Ruslan Kuprieiev
parent
b58ebff5db
commit
067442f348
+6
-1
@@ -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
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user