Merge branch '12519-multisite-project-search'
[arvados.git] / sdk / cwl / arvados_cwl / runner.py
index bb4fac2ae9541a55872ff6fd371b380659a0f15e..c55e976924f65bd362153a0921152e5a170ca47b 100644 (file)
@@ -46,6 +46,11 @@ def trim_anonymous_location(obj):
     if obj.get("location", "").startswith("_:"):
         del obj["location"]
 
+def remove_redundant_fields(obj):
+    for field in ("path", "nameext", "nameroot", "dirname"):
+        if field in obj:
+            del obj[field]
+
 def find_defaults(d, op):
     if isinstance(d, list):
         for i in d:
@@ -288,6 +293,12 @@ class Runner(object):
         self.tool = tool
         self.job_order = job_order
         self.running = False
+        if enable_reuse:
+            # If reuse is permitted by command line arguments but
+            # disabled by the workflow itself, disable it.
+            reuse_req, _ = get_feature(self.tool, "http://arvados.org/cwl#ReuseRequirement")
+            if reuse_req:
+                enable_reuse = reuse_req["enableReuse"]
         self.enable_reuse = enable_reuse
         self.uuid = None
         self.final_output = None