19109: Avoid recursion fail mode
authorPeter Amstutz <peter.amstutz@curii.com>
Thu, 12 May 2022 21:20:55 +0000 (17:20 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Thu, 12 May 2022 21:20:55 +0000 (17:20 -0400)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

sdk/cwl/arvados_cwl/runner.py

index 995b23c080c361f5ac387b9ea47e128946fb79e2..c8668afcac2be23c6ccb38b15f6a5b77b7327839 100644 (file)
@@ -166,10 +166,13 @@ def set_secondary(fsaccess, builder, inputschema, secondaryspec, primary, discov
             set_secondary(fsaccess, builder, {"type": inputschema["items"]}, secondaryspec, p, discovered)
 
     elif (inputschema["type"] == "File" and
-          secondaryspec and
           isinstance(primary, Mapping) and
-          primary.get("class") == "File" and
-          "secondaryFiles" not in primary):
+          primary.get("class") == "File"):
+
+        if "secondaryFiles" in primary or not secondaryspec:
+            # Nothing to do.
+            return
+
         #
         # Found a file, check for secondaryFiles
         #