Copy-paste fixes

This commit is contained in:
Pavel Kiselev 2017-02-08 19:36:44 +07:00
parent b7b8db7cfd
commit 69d1c4c9b7
No known key found for this signature in database
GPG Key ID: 4964A418B307836D

View File

@ -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"))