Fix setting workflow label field from record name fixes #16083
authorPeter Amstutz <peter.amstutz@curii.com>
Thu, 23 Jan 2020 22:09:59 +0000 (17:09 -0500)
committerPeter Amstutz <peter.amstutz@curii.com>
Thu, 23 Jan 2020 22:09:59 +0000 (17:09 -0500)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

sdk/cwl/arvados_cwl/fsaccess.py

index c1ea586b0475db4c5b1a780fea5eab11bb02d11f..bc2c5e34d7b6c2737cc8bdcb541fc1daf394d9ae 100644 (file)
@@ -229,8 +229,9 @@ class CollectionFetcher(DefaultFetcher):
                 return f.read()
         if url.startswith("arvwf:"):
             record = self.api_client.workflows().get(uuid=url[6:]).execute(num_retries=self.num_retries)
-            definition = record["definition"] + ('\nlabel: "%s"\n' % record["name"].replace('"', '\\"'))
-            return definition
+            definition = yaml.round_trip_load(record["definition"])
+            definition["label"] = record["name"]
+            return yaml.round_trip_dump(definition)
         return super(CollectionFetcher, self).fetch_text(url)
 
     def check_exists(self, url):