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>
Mon, 11 May 2020 15:08:22 +0000 (11:08 -0400)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

sdk/cwl/arvados_cwl/runner.py

index f0be83032415bf64e0a64c793c8b0b7e9974bdd3..7bb66a158e50646f1fc984df7ea30ccd31528bf3 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