projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '21366-subprocess-output-loading-bug' into main. Closes #21366
[arvados.git]
/
services
/
crunch-dispatch-slurm
/
script.go
diff --git
a/services/crunch-dispatch-slurm/script.go
b/services/crunch-dispatch-slurm/script.go
index 93ae6b5eb3cf8b07584cd9df011fa36acb816e83..d0bfbc4a929dd8067a8e3e3e519b17dc0777f475 100644
(file)
--- a/
services/crunch-dispatch-slurm/script.go
+++ b/
services/crunch-dispatch-slurm/script.go
@@
-1,11
+1,21
@@
-package main
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+package dispatchslurm
import (
"strings"
)
import (
"strings"
)
-func execScript(args []string) string {
- s := "#!/bin/sh\nexec"
+func execScript(args []string, env map[string]string) string {
+ s := "#!/bin/sh\n"
+ for k, v := range env {
+ s += k + `='`
+ s += strings.Replace(v, `'`, `'\''`, -1)
+ s += `' `
+ }
+ s += `exec`
for _, w := range args {
s += ` '`
s += strings.Replace(w, `'`, `'\''`, -1)
for _, w := range args {
s += ` '`
s += strings.Replace(w, `'`, `'\''`, -1)