import arvados.arvfile
import arvados.errors
+from googleapiclient.errors import HttpError
+
from schema_salad.ref_resolver import DefaultFetcher
logger = logging.getLogger('arvados.cwl-runner')
min_entries=2):
self.api_client = api_client
self.keep_client = keep_client
+ self.num_retries = num_retries
self.collections = OrderedDict()
self.lock = threading.Lock()
self.total = 0
if pdh not in self.collections:
logger.debug("Creating collection reader for %s", pdh)
cr = arvados.collection.CollectionReader(pdh, api_client=self.api_client,
- keep_client=self.keep_client)
+ keep_client=self.keep_client,
+ num_retries=self.num_retries)
sz = len(cr.manifest_text()) * 128
self.collections[pdh] = (cr, sz)
self.total += sz
return super(CollectionFsAccess, self).open(self._abs(fn), mode)
def exists(self, fn):
- collection, rest = self.get_collection(fn)
+ try:
+ collection, rest = self.get_collection(fn)
+ except HttpError as err:
+ if err.resp.status == 404:
+ return False
+ else:
+ raise
if collection is not None:
if rest:
return collection.exists(rest)