mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
Revert "Make drivers take arguments as a list and not as a string"
This commit is contained in:
@@ -29,6 +29,7 @@ type BasicExecutor struct {
|
||||
allocDir string
|
||||
}
|
||||
|
||||
// TODO: Have raw_exec use this as well.
|
||||
func NewBasicExecutor() Executor {
|
||||
return &BasicExecutor{}
|
||||
}
|
||||
@@ -62,7 +63,12 @@ func (e *BasicExecutor) Start() error {
|
||||
}
|
||||
|
||||
e.cmd.Path = args.ReplaceEnv(e.cmd.Path, envVars.Map())
|
||||
e.cmd.Args = args.ParseAndReplace(e.cmd.Args, envVars.Map())
|
||||
combined := strings.Join(e.cmd.Args, " ")
|
||||
parsed, err := args.ParseAndReplace(combined, envVars.Map())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
e.cmd.Args = parsed
|
||||
|
||||
spawnState := filepath.Join(e.allocDir, fmt.Sprintf("%s_%s", e.taskName, "exit_status"))
|
||||
e.spawn = spawn.NewSpawner(spawnState)
|
||||
|
||||
@@ -167,7 +167,12 @@ func (e *LinuxExecutor) Start() error {
|
||||
}
|
||||
|
||||
e.cmd.Path = args.ReplaceEnv(e.cmd.Path, envVars.Map())
|
||||
e.cmd.Args = args.ParseAndReplace(e.cmd.Args, envVars.Map())
|
||||
combined := strings.Join(e.cmd.Args, " ")
|
||||
parsed, err := args.ParseAndReplace(combined, envVars.Map())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
e.cmd.Args = parsed
|
||||
|
||||
spawnState := filepath.Join(e.allocDir, fmt.Sprintf("%s_%s", e.taskName, "exit_status"))
|
||||
e.spawn = spawn.NewSpawner(spawnState)
|
||||
|
||||
@@ -112,7 +112,7 @@ func Executor_Start_Wait(t *testing.T, command buildExecCommand) {
|
||||
expected := "hello world"
|
||||
file := filepath.Join(allocdir.TaskLocal, "output.txt")
|
||||
absFilePath := filepath.Join(taskDir, file)
|
||||
cmd := fmt.Sprintf(`/bin/sleep 1 ; echo -n %v > %v`, expected, file)
|
||||
cmd := fmt.Sprintf(`"%v \"%v\" > %v"`, "/bin/sleep 1 ; echo -n", expected, file)
|
||||
e := command("/bin/bash", "-c", cmd)
|
||||
|
||||
if err := e.Limit(constraint); err != nil {
|
||||
@@ -190,7 +190,7 @@ func Executor_Open(t *testing.T, command buildExecCommand, newExecutor func() Ex
|
||||
expected := "hello world"
|
||||
file := filepath.Join(allocdir.TaskLocal, "output.txt")
|
||||
absFilePath := filepath.Join(taskDir, file)
|
||||
cmd := fmt.Sprintf(`/bin/sleep 1 ; echo -n %v > %v`, expected, file)
|
||||
cmd := fmt.Sprintf(`"%v \"%v\" > %v"`, "/bin/sleep 1 ; echo -n", expected, file)
|
||||
e := command("/bin/bash", "-c", cmd)
|
||||
|
||||
if err := e.Limit(constraint); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user