Skip to content

Commit b7f87da

Browse files
authored
Merge pull request #525 from kapilkd13/generation_warn
Removing unnecessary warning due to generation field
2 parents a22bed6 + ce83446 commit b7f87da

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

cwltool/draft2tool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,15 +534,15 @@ def collect_output_ports(self, ports, builder, outdir, compute_checksum=True, jo
534534
visit_class(ret, ("File", "Directory"), cast(Callable[[Any], Any], revmap))
535535
visit_class(ret, ("File", "Directory"), remove_path)
536536
normalizeFilesDirs(ret)
537-
if builder.mutation_manager:
538-
adjustFileObjs(ret, builder.mutation_manager.set_generation)
539537
visit_class(ret, ("File", "Directory"), partial(check_valid_locations, fs_access))
540538

541539
if compute_checksum:
542540
adjustFileObjs(ret, partial(compute_checksums, fs_access))
543541

544542
validate.validate_ex(self.names.get_name("outputs_record_schema", ""), ret,
545543
strict=False, logger=_logger_validation_warnings)
544+
if ret is not None and builder.mutation_manager is not None:
545+
adjustFileObjs(ret, builder.mutation_manager.set_generation)
546546
return ret if ret is not None else {}
547547
except validate.ValidationException as e:
548548
raise WorkflowException("Error validating output record. " + Text(e) + "\n in " + json.dumps(ret, indent=4))

cwltool/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,9 @@ def locToPath(p):
915915

916916
visit_class(out, ("File", "Directory"), locToPath)
917917

918+
# Unsetting the Generation fron final output object
919+
visit_class(out,("File",), MutationManager().unset_generation)
920+
918921
if isinstance(out, six.string_types):
919922
stdout.write(out)
920923
else:

cwltool/mutation.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,7 @@ def set_generation(self, obj):
6767
loc = obj["location"]
6868
current = self.generations.get(loc, MutationState(0,[], ""))
6969
obj[_generation] = current.generation
70+
71+
def unset_generation(self, obj):
72+
# type: (Dict) -> None
73+
obj.pop(_generation, None)

0 commit comments

Comments
 (0)