Skip to content

Short circuit google storage schemas during validation. #613

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions cwltool/schemas/v1.0/salad/schema_salad/ref_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def fetch_text(self, url):
else:
raise RuntimeError('Error reading %s: %s' % (url, e))
else:
raise ValueError('Unsupported scheme in url: %s' % url)
raise ValueError('Unsupported scheme in url: %s for scheme %s' % (url, scheme))

def check_exists(self, url): # type: (Text) -> bool
if url in self.cache:
Expand All @@ -173,8 +173,11 @@ def check_exists(self, url): # type: (Text) -> bool
return True
elif scheme == 'file':
return os.path.exists(urllib.request.url2pathname(str(path)))
# Google storage links are protected by user accounts and thus are not subject to external validation
elif scheme == 'gs':
return True
else:
raise ValueError('Unsupported scheme in url: %s' % url)
raise ValueError('Error while checking link exists: Unsupported scheme %s in url: %s' % (scheme, url))

def urljoin(self, base_url, url): # type: (Text, Text) -> Text

Expand Down