From 69d1c4c9b74bf0fc7d1ee90a7b90f5d3205aa0fb Mon Sep 17 00:00:00 2001 From: Pavel Kiselev Date: Wed, 8 Feb 2017 19:36:44 +0700 Subject: [PATCH] Copy-paste fixes --- api/tasks/runner.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/tasks/runner.go b/api/tasks/runner.go index 124270fd..c823c6e6 100644 --- a/api/tasks/runner.go +++ b/api/tasks/runner.go @@ -227,7 +227,7 @@ func (t *task) updateRepository() error { cmd.Dir = util.Config.TmpPath gitSshCommand := "ssh -o StrictHostKeyChecking=no -i " + t.repository.SshKey.GetPath() - cmd.Env = t.envVars(util.Config.TmpPath, util.Config.TmpPath, gitSshCommand) + cmd.Env = t.envVars(util.Config.TmpPath, util.Config.TmpPath, &gitSshCommand) repoURL, repoTag := t.repository.GitUrl, "master" if split := strings.Split(repoURL, "#"); len(split) > 1 { @@ -263,7 +263,7 @@ func (t *task) runGalaxy() error { cmd.Dir = util.Config.TmpPath + "/repository_" + strconv.Itoa(t.repository.ID) gitSshCommand := "ssh -o StrictHostKeyChecking=no -i " + t.repository.SshKey.GetPath() - cmd.Env = t.envVars(util.Config.TmpPath, cmd.Dir, gitSshCommand) + cmd.Env = t.envVars(util.Config.TmpPath, cmd.Dir, &gitSshCommand) if _, err := os.Stat(cmd.Dir + "/roles/requirements.yml"); err != nil { return nil @@ -325,8 +325,8 @@ func (t *task) runPlaybook() error { func (t *task) envVars(home string, pwd string, gitSshCommand *string) []string { env := os.Environ() - env = append(env, fmt.Sprintf("HOME=%s", util.Config.TmpPath)) - env = append(env, fmt.Sprintf("PWD=%s", cmd.Dir)) + env = append(env, fmt.Sprintf("HOME=%s", home)) + env = append(env, fmt.Sprintf("PWD=%s", pwd)) env = append(env, fmt.Sprintln("PYTHONUNBUFFERED=1")) //env = append(env, fmt.Sprintln("GIT_FLUSH=1"))