Skip to content

Commit d0d0ec2

Browse files
committed
Merge remote-tracking branch 'origin/cwlprov_conf_fixes' into toil-prov
2 parents f35a5c7 + f960ac6 commit d0d0ec2

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

cwltool/main.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,18 @@ def my_represent_none(self, data): # pylint: disable=unused-argument
836836
if runtimeContext.research_obj is not None:
837837
runtimeContext.research_obj.create_job(
838838
out, None, True)
839+
def remove_at_id(doc): # type: MutableMapping -> None
840+
for key in list(doc.keys()):
841+
if key == '@id':
842+
del doc[key]
843+
else:
844+
value = doc[key]
845+
if isinstance(value, MutableMapping):
846+
remove_at_id(value)
847+
elif isinstance(value, MutableSequence):
848+
for entry in value:
849+
remove_at_id(entry)
850+
remove_at_id(out)
839851

840852
def loc_to_path(obj): # type: (Dict[Text, Any]) -> None
841853
for field in ("path", "nameext", "nameroot", "dirname"):

cwltool/provenance.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,12 @@ def declare_file(self, value):
549549
# Check for secondaries
550550
for sec in value.get("secondaryFiles", ()):
551551
# TODO: Record these in a specializationOf entity with UUID?
552-
(sec_entity, _, _) = self.declare_file(sec)
552+
if sec['class'] == "File":
553+
(sec_entity, _, _) = self.declare_file(sec)
554+
elif sec['class'] == "Directory":
555+
sec_entity = self.declare_directory(sec)
556+
else:
557+
raise ValueError("Got unexpected secondaryFiles value: {}".format(sec))
553558
# We don't know how/when/where the secondary file was generated,
554559
# but CWL convention is a kind of summary/index derived
555560
# from the original file. As its generally in a different format

0 commit comments

Comments
 (0)