[ARVADOS] updated: 223dfd6ecc319842894a6be3f06c64813c5e4a8d
Git user
git at public.curoverse.com
Mon Jan 23 10:20:55 EST 2017
Summary of changes:
sdk/cwl/arvados_cwl/fsaccess.py | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
via 223dfd6ecc319842894a6be3f06c64813c5e4a8d (commit)
from dc17bad908428e268b8ac1cab966902ce4c67d03 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 223dfd6ecc319842894a6be3f06c64813c5e4a8d
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Mon Jan 23 10:20:46 2017 -0500
10812: Handle expected NotFoundError error when checking if file exists in keep.
diff --git a/sdk/cwl/arvados_cwl/fsaccess.py b/sdk/cwl/arvados_cwl/fsaccess.py
index 02e1656..a99b2a7 100644
--- a/sdk/cwl/arvados_cwl/fsaccess.py
+++ b/sdk/cwl/arvados_cwl/fsaccess.py
@@ -3,6 +3,7 @@ import os
import errno
import urlparse
import re
+import logging
import ruamel.yaml as yaml
@@ -13,9 +14,12 @@ import cwltool.resolver
import arvados.util
import arvados.collection
import arvados.arvfile
+import arvados.errors
from schema_salad.ref_resolver import DefaultFetcher
+logger = logging.getLogger('arvados.cwl-runner')
+
class CollectionFsAccess(cwltool.stdfsaccess.StdFsAccess):
"""Implement the cwltool FsAccess interface for Arvados Collections."""
@@ -146,11 +150,17 @@ class CollectionFetcher(DefaultFetcher):
return super(CollectionFetcher, self).fetch_text(url)
def check_exists(self, url):
- if url.startswith("keep:"):
- return self.fsaccess.exists(url)
- if url.startswith("arvwf:"):
- if self.fetch_text(url):
- return True
+ try:
+ if url.startswith("keep:"):
+ return self.fsaccess.exists(url)
+ if url.startswith("arvwf:"):
+ if self.fetch_text(url):
+ return True
+ except arvados.errors.NotFoundError:
+ return False
+ except:
+ logger.exception("Got unexpected exception checking if file exists:")
+ return False
return super(CollectionFetcher, self).check_exists(url)
def urljoin(self, base_url, url):
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list