16339: Fix $schemas rewriting bug
authorPeter Amstutz <peter.amstutz@curii.com>
Mon, 11 May 2020 15:08:01 +0000 (11:08 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Tue, 9 Jun 2020 17:38:46 +0000 (13:38 -0400)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

sdk/cwl/arvados_cwl/runner.py

index 2239e0f9df952b9ab75a7e9a96ab46953ab29f94..4c2e6697d5bf18bca4c77189b3a0efd4f1ad2899 100644 (file)
@@ -42,6 +42,7 @@ import schema_salad.validate as validate
 import arvados.collection
 from .util import collectionUUID
 import ruamel.yaml as yaml
+from ruamel.yaml.comments import CommentedMap, CommentedSeq
 
 import arvados_cwl.arvdocker
 from .pathmapper import ArvPathMapper, trim_listing, collection_pdh_pattern, collection_uuid_pattern
@@ -392,7 +393,7 @@ def upload_dependencies(arvrunner, name, document_loader,
             discovered_secondaryfiles[mapper.mapper(d).resolved] = discovered[d]
 
     if "$schemas" in workflowobj:
-        sch = []
+        sch = CommentedSeq()
         for s in workflowobj["$schemas"]:
             sch.append(mapper.mapper(s).resolved)
         workflowobj["$schemas"] = sch