projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
19280: Try this again
[arvados.git]
/
sdk
/
cwl
/
arvados_cwl
/
pathmapper.py
diff --git
a/sdk/cwl/arvados_cwl/pathmapper.py
b/sdk/cwl/arvados_cwl/pathmapper.py
index e0216aae52b352b2d970fbe7bf13bf14f8668423..64fdfa0d04032e97235dc581144d9cb74494c597 100644
(file)
--- a/
sdk/cwl/arvados_cwl/pathmapper.py
+++ b/
sdk/cwl/arvados_cwl/pathmapper.py
@@
-156,17
+156,23
@@
class ArvPathMapper(PathMapper):
if loc.startswith("_:"):
return True
if loc.startswith("_:"):
return True
- i
f not prefix:
- i = loc.rfind("/")
- if i > -1:
- prefix = loc[:i+1]
- suffix = urllib.parse.quote(urllib.parse.unquote(loc[i+1:]), "/+@")
- else:
- prefix = loc+"/"
+ i
= loc.rfind("/")
+ if i > -1:
+ loc_prefix = loc[:i+1]
+ if not prefix:
+ prefix = loc_prefix
+ # quote/unquote to ensure consistent quoting
+ suffix = urllib.parse.quote(urllib.parse.unquote(loc[i+1:]), "/+@")
else:
else:
- suffix = loc[len(prefix):]
+ # no '/' found
+ loc_prefix = loc+"/"
+ prefix = loc+"/"
+ suffix = ""
+
+ if prefix != loc_prefix:
+ return True
- if
prefix+suffix != prefix+
urllib.parse.quote(srcobj["basename"], "/+@"):
+ if
"basename" in srcobj and suffix !=
urllib.parse.quote(srcobj["basename"], "/+@"):
return True
if srcobj["class"] == "File" and loc not in self._pathmap:
return True
if srcobj["class"] == "File" and loc not in self._pathmap:
@@
-175,7
+181,7
@@
class ArvPathMapper(PathMapper):
if self.needs_new_collection(s, prefix):
return True
if srcobj.get("listing"):
if self.needs_new_collection(s, prefix):
return True
if srcobj.get("listing"):
- prefix = "%s%s/" % (prefix,
srcobj["basename"]
)
+ prefix = "%s%s/" % (prefix,
urllib.parse.quote(srcobj.get("basename", suffix), "/+@")
)
for l in srcobj["listing"]:
if self.needs_new_collection(l, prefix):
return True
for l in srcobj["listing"]:
if self.needs_new_collection(l, prefix):
return True