projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
20862: Fix charset middleware.
[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 fb16e593e5c5648720452fd49194910a4b2021b5..d0bfbc4a929dd8067a8e3e3e519b17dc0777f475 100644
(file)
--- a/
services/crunch-dispatch-slurm/script.go
+++ b/
services/crunch-dispatch-slurm/script.go
@@
-8,8
+8,14
@@
import (
"strings"
)
"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)