import logging
import json
import os
+import urllib
import ruamel.yaml as yaml
dirs = set()
for f in self.pathmapper.files():
- pdh, p, tp = self.pathmapper.mapper(f)
+ pdh, p, tp, stg = self.pathmapper.mapper(f)
if tp == "Directory" and '/' not in pdh:
mounts[p] = {
"kind": "collection",
dirs.add(pdh)
for f in self.pathmapper.files():
- res, p, tp = self.pathmapper.mapper(f)
- pdh, path = res[5:].split("/", 1)
+ res, p, tp, stg = self.pathmapper.mapper(f)
+ if res.startswith("keep:"):
+ res = res[5:]
+ elif res.startswith("/keep/"):
+ res = res[6:]
+ else:
+ continue
+ sp = res.split("/", 1)
+ pdh = sp[0]
if pdh not in dirs:
mounts[p] = {
"kind": "collection",
"portable_data_hash": pdh
}
- if path:
- mounts[p]["path"] = path
+ if len(sp) == 2:
+ mounts[p]["path"] = urllib.unquote(sp[1])
with Perf(metrics, "generatefiles %s" % self.name):
if self.generatefiles["listing"]:
container_request["environment"].update(self.environment)
if self.stdin:
- raise UnsupportedRequirement("Stdin redirection currently not suppported")
+ sp = self.stdin[6:].split("/", 1)
+ mounts["stdin"] = {"kind": "collection",
+ "portable_data_hash": sp[0],
+ "path": sp[1]}
if self.stderr:
- raise UnsupportedRequirement("Stderr redirection currently not suppported")
+ mounts["stderr"] = {"kind": "file",
+ "path": "%s/%s" % (self.outdir, self.stderr)}
if self.stdout:
mounts["stdout"] = {"kind": "file",