X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/20364bc1aed2dcad71b006f4314ba0720d20ae05..e59c1d365d9b6e1eff9b5cb030a8b1a3aaf14353:/sdk/cwl/arvados_cwl/fsaccess.py diff --git a/sdk/cwl/arvados_cwl/fsaccess.py b/sdk/cwl/arvados_cwl/fsaccess.py index 534a675525..7736cab4d8 100644 --- a/sdk/cwl/arvados_cwl/fsaccess.py +++ b/sdk/cwl/arvados_cwl/fsaccess.py @@ -149,13 +149,16 @@ class CollectionFsAccess(cwltool.stdfsaccess.StdFsAccess): return os.path.realpath(path) class CollectionFetcher(DefaultFetcher): - def __init__(self, cache, session, api_client=None, fs_access=None, num_retries=4): + def __init__(self, cache, session, api_client=None, fs_access=None, num_retries=4, overrides=None): super(CollectionFetcher, self).__init__(cache, session) self.api_client = api_client self.fsaccess = fs_access self.num_retries = num_retries + self.overrides = overrides if overrides else {} def fetch_text(self, url): + if url in self.overrides: + return self.overrides[url] if url.startswith("keep:"): with self.fsaccess.open(url, "r") as f: return f.read() @@ -166,6 +169,8 @@ class CollectionFetcher(DefaultFetcher): return super(CollectionFetcher, self).fetch_text(url) def check_exists(self, url): + if url in self.overrides: + return True try: if url.startswith("http://arvados.org/cwl"): return True