10129: Ensure that directory literals get preserved when trimming keep directory...
[arvados.git] / sdk / cwl / arvados_cwl / arvworkflow.py
index 59760810f3038673ac00cc04323b63612a6eefea..3bb0a34197594774f81049ff5ccdf606dc2dfcde 100644 (file)
@@ -85,12 +85,13 @@ class ArvadosWorkflow(Workflow):
             def keepmount(obj):
                 if obj["location"].startswith("keep:"):
                     obj["location"] = "/keep/" + obj["location"][5:]
+                    if "listing" in obj:
+                        del obj["listing"]
                 elif obj["location"].startswith("_:"):
-                    pass
+                    del obj["location"]
                 else:
                     raise WorkflowException("Location is not a keep reference or a literal: '%s'" % obj["location"])
-                if "listing" in obj:
-                    del obj["listing"]
+
             adjustFileObjs(joborder_keepmount, keepmount)
             adjustDirObjs(joborder_keepmount, keepmount)
             adjustFileObjs(packed, keepmount)