14322: Tweak workbench support from manual testing
authorPeter Amstutz <pamstutz@veritasgenetics.com>
Wed, 13 Mar 2019 20:19:37 +0000 (16:19 -0400)
committerPeter Amstutz <pamstutz@veritasgenetics.com>
Fri, 15 Mar 2019 15:33:29 +0000 (11:33 -0400)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz@veritasgenetics.com>

apps/workbench/app/helpers/application_helper.rb
sdk/cwl/arvados_cwl/fsaccess.py

index e241b52d0157e3ef602fccfd86f1797ed6f9157a..46b9a306d606267802043ea2465ffbdf0aa6a2b8 100644 (file)
@@ -497,9 +497,9 @@ module ApplicationHelper
       if attrvalue.is_a? Hash
         display_value = attrvalue[:"http://arvados.org/cwl#collectionUUID"] || attrvalue[:"arv:collection"] || attrvalue[:location]
         re = CollectionsHelper.match_uuid_with_optional_filepath(display_value)
-        locationre = CollectionsHelper.match(attrvalue[:location])
+        locationre = CollectionsHelper.match(attrvalue[:location][5..-1])
         if re
-          if locationre[4]
+          if locationre and locationre[4]
             display_value = "#{Collection.find(re[1]).name} / #{locationre[4][1..-1]}"
           else
             display_value = Collection.find(re[1]).name
index 6eb1bf64093caed7e326401634145d28742bce0d..252ca57d47bb30ad1834e7070b3cfdf1e0ffdbb1 100644 (file)
@@ -70,9 +70,12 @@ class CollectionCache(object):
                 if m:
                     self.cap_cache(int(m.group(2)) * 128)
                 logger.debug("Creating collection reader for %s", locator)
-                cr = arvados.collection.CollectionReader(locator, api_client=self.api_client,
-                                                         keep_client=self.keep_client,
-                                                         num_retries=self.num_retries)
+                try:
+                    cr = arvados.collection.CollectionReader(locator, api_client=self.api_client,
+                                                             keep_client=self.keep_client,
+                                                             num_retries=self.num_retries)
+                except arvados.errors.ApiError as ap:
+                    raise IOError(errno.ENOENT, "Could not access collection '%s': %s" % (locator, str(ap._get_reason())))
                 sz = len(cr.manifest_text()) * 128
                 self.collections[locator] = (cr, sz)
                 self.total += sz