From 4e5838bd9e1a7baa5b3e53e97e308140e4b6105f Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Tue, 2 Aug 2022 12:40:27 -0400 Subject: [PATCH] 19280: explicitly include/exclude primary Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- sdk/cwl/arvados_cwl/runner.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sdk/cwl/arvados_cwl/runner.py b/sdk/cwl/arvados_cwl/runner.py index d2486c164b..d2dfcf26bc 100644 --- a/sdk/cwl/arvados_cwl/runner.py +++ b/sdk/cwl/arvados_cwl/runner.py @@ -417,8 +417,14 @@ def upload_dependencies(arvrunner, name, document_loader, normalizeFilesDirs(sc) - if include_primary and "id" in workflowobj: - sc.append({"class": "File", "location": workflowobj["id"]}) + if "id" in workflowobj: + defrg, _ = urllib.parse.urldefrag(workflowobj["id"]) + if include_primary: + # make sure it's included + sc.append({"class": "File", "location": defrg}) + else: + # make sure it's excluded + sc = [d for d in sc if d.get("location") != defrg] def visit_default(obj): def defaults_are_optional(f): -- 2.30.2