17004: Set default collection output name "Output from workflow XYZ"
[arvados.git] / sdk / cwl / arvados_cwl / executor.py
index 1a4bf65a57b943a2aa214c50e0ebbe10538863c2..7fdf07de254578af5b8778ceda2c10d0d8cf7561 100644 (file)
@@ -627,6 +627,9 @@ The 'jobs' API is no longer supported.
         runtimeContext.tmpdir_prefix = "tmp"
         runtimeContext.work_api = self.work_api
 
+        if not self.output_name:
+             self.output_name = "Output from workflow %s" % runtimeContext.name
+
         if self.work_api == "containers":
             if self.ignore_docker_for_reuse:
                 raise Exception("--ignore-docker-for-reuse not supported with containers API.")
@@ -779,8 +782,6 @@ The 'jobs' API is no longer supported.
             if workbench2 or workbench1:
                 logger.info("Output at %scollections/%s", workbench2 or workbench1, tool.final_output)
         else:
-            if self.output_name is None:
-                self.output_name = "Output of %s" % (shortname(tool.tool["id"]))
             if self.output_tags is None:
                 self.output_tags = ""
 
@@ -792,7 +793,7 @@ The 'jobs' API is no longer supported.
                 storage_classes = runtimeContext.storage_classes.strip().split(",")
 
             output_properties = {}
-            output_properties_req, _ = self.get_requirement("http://arvados.org/cwl#OutputCollectionProperties")
+            output_properties_req, _ = tool.get_requirement("http://arvados.org/cwl#OutputCollectionProperties")
             if output_properties_req:
                 for pr in output_properties_req["outputProperties"]:
                     output_properties[pr["propertyName"]] = self.builder.do_eval(pr["propertyValue"])