Skip to content

Commit

Permalink
Apply linter suggestions concerning lstrip()
Browse files Browse the repository at this point in the history
  • Loading branch information
lopiola committed Sep 14, 2023
1 parent 63c3b77 commit 4c8e526
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/galaxy/files/sources/onedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
from ._pyfilesystem2 import PyFilesystem2FilesSource


def remove_prefix(prefix, string):
if string.startswith(prefix):
string = string[len(prefix):]
return string


class OnedataFilesSource(PyFilesystem2FilesSource):
plugin_type = "onedata"
required_module = OnedataRESTFS
Expand All @@ -16,7 +22,7 @@ class OnedataFilesSource(PyFilesystem2FilesSource):
def _open_fs(self, user_context=None, opts: Optional[FilesSourceOptions] = None):
props = self._serialization_props(user_context)
onezone_domain = props.pop("onezoneDomain", {}) or ""
onezone_domain = onezone_domain.lstrip("https://").lstrip("http://")
onezone_domain = remove_prefix("http://", remove_prefix("https://", onezone_domain))
access_token = props.pop("accessToken", {}) or ""
handle = OnedataRESTFS(onezone_domain, access_token)
return handle
Expand Down

0 comments on commit 4c8e526

Please sign in to comment.