Merge branch 'master' into 10081-cwl-run-same-job
[arvados.git] / sdk / cwl / arvados_cwl / pathmapper.py
index ffdade0f5ecbc1562e67dfacdf090c77e7fa24c2..0fd9a0ed332ececaf4474ca3939fe9b4785db82d 100644 (file)
@@ -6,7 +6,7 @@ import os
 import arvados.commands.run
 import arvados.collection
 
-from cwltool.pathmapper import PathMapper, MapperEnt, abspath
+from cwltool.pathmapper import PathMapper, MapperEnt, abspath, adjustFileObjs, adjustDirObjs
 from cwltool.workflow import WorkflowException
 
 logger = logging.getLogger('arvados.cwl-runner')
@@ -42,8 +42,11 @@ class ArvPathMapper(PathMapper):
                     uploadfiles.add((src, ab, st))
                 elif isinstance(st, arvados.commands.run.ArvFile):
                     self._pathmap[src] = MapperEnt(ab, st.fn, "File")
-                elif src.startswith("_:") and "contents" in srcobj:
-                    pass
+                elif src.startswith("_:"):
+                    if "contents" in srcobj:
+                        pass
+                    else:
+                        raise WorkflowException("File literal '%s' is missing contents" % src)
                 else:
                     raise WorkflowException("Input file path '%s' is invalid" % st)
             if "secondaryFiles" in srcobj: