projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '19872-mnt-cache-limits' refs #19872
[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 f559104d14a9fdeda00ba52899def1315228e1e7..d0bfbc4a929dd8067a8e3e3e519b17dc0777f475 100644
(file)
--- a/
services/crunch-dispatch-slurm/script.go
+++ b/
services/crunch-dispatch-slurm/script.go
@@
-2,14
+2,20
@@
//
// SPDX-License-Identifier: AGPL-3.0
//
// SPDX-License-Identifier: AGPL-3.0
-package
main
+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)