Skip to content

Commit 0add049

Browse files
author
Peter Amstutz
committed
Handle http for job order.
1 parent b11d0fe commit 0add049

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

wes_client/__init__.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ def main(argv=sys.argv[1:]):
8282
return 0
8383

8484
loader = schema_salad.ref_resolver.Loader({
85-
"location": {"@type": "@id"}
85+
"location": {"@type": "@id"},
86+
"path": {"@type": "@id"}
8687
})
8788
input, _ = loader.resolve_ref(args.job_order)
8889

@@ -91,10 +92,13 @@ def main(argv=sys.argv[1:]):
9192
def fixpaths(d):
9293
if isinstance(d, dict):
9394
if "path" in d:
94-
local_path = os.path.normpath(
95-
os.path.join(os.getcwd(), basedir, d["path"]))
95+
if ":" not in d["path"]:
96+
local_path = os.path.normpath(
97+
os.path.join(os.getcwd(), basedir, d["path"]))
98+
d["location"] = urllib.pathname2url(local_path)
99+
else:
100+
d["location"] = d["path"]
96101
del d["path"]
97-
d["location"] = urllib.pathname2url(local_path)
98102
if d.get("class") == "Directory":
99103
loc = d.get("location", "")
100104
if loc.startswith("http:") or loc.startswith("https:"):

0 commit comments

Comments
 (0)