From 7cc2d4585f54e1121e295b07a12a52748bbe0792 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Thu, 7 Oct 2021 22:12:06 -0400 Subject: [PATCH] Accept PDH on command line. No issue # Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- arvados.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/arvados.go b/arvados.go index 50ab375f81..4aeef48a70 100644 --- a/arvados.go +++ b/arvados.go @@ -392,16 +392,20 @@ func (runner *arvadosContainerRunner) TranslatePaths(paths ...*string) error { if m == nil { return fmt.Errorf("cannot find uuid in path: %q", *path) } - uuid := m[2] - mnt, ok := runner.Mounts["/mnt/"+uuid] + collID := m[2] + mnt, ok := runner.Mounts["/mnt/"+collID] if !ok { mnt = map[string]interface{}{ "kind": "collection", - "uuid": uuid, } - runner.Mounts["/mnt/"+uuid] = mnt + if len(collID) == 27 { + mnt["uuid"] = collID + } else { + mnt["portable_data_hash"] = collID + } + runner.Mounts["/mnt/"+collID] = mnt } - *path = "/mnt/" + uuid + m[3] + *path = "/mnt/" + collID + m[3] } return nil } @@ -533,7 +537,7 @@ func open(fnm string) (file, error) { return os.Open(fnm) } collectionUUID := m[2] - collectionPath := fnm[strings.Index(fnm, collectionUUID)+len(collectionUUID):] + collectionPath := m[3] siteFSMtx.Lock() defer siteFSMtx.Unlock() -- 2.30.2