Merge pull request #1145 from jsoriano/fix-env-order-lang-c

Force LANG=C before appending rest of environment
This commit is contained in:
Rickard von Essen 2014-05-08 21:27:10 +02:00
commit c1cfd1da46
3 changed files with 3 additions and 5 deletions

View File

@ -89,8 +89,8 @@ func (c *Communicator) UploadDir(dst string, src string, exclude []string) error
var stderr bytes.Buffer
cmd := ShellCommand(cpCmd)
cmd.Env = append(cmd.Env, os.Environ()...)
cmd.Env = append(cmd.Env, "LANG=C")
cmd.Env = append(cmd.Env, os.Environ()...)
cmd.Stderr = &stderr
err = cmd.Run()
if err == nil {

View File

@ -34,11 +34,10 @@ func (f *IfconfigIPFinder) HostIP() (string, error) {
stdout := new(bytes.Buffer)
cmd := exec.Command(ifconfigPath, device)
cmd.Env = append(cmd.Env, os.Environ()...)
// Force LANG=C so that the output is what we expect it to be
// despite the locale.
cmd.Env = append(cmd.Env, "LANG=C")
cmd.Env = append(cmd.Env, os.Environ()...)
cmd.Stdout = stdout
cmd.Stderr = new(bytes.Buffer)

View File

@ -33,11 +33,10 @@ func (f *IfconfigIPFinder) HostIP() (string, error) {
stdout := new(bytes.Buffer)
cmd := exec.Command(ifconfigPath, f.Device)
cmd.Env = append(cmd.Env, os.Environ()...)
// Force LANG=C so that the output is what we expect it to be
// despite the locale.
cmd.Env = append(cmd.Env, "LANG=C")
cmd.Env = append(cmd.Env, os.Environ()...)
cmd.Stdout = stdout
cmd.Stderr = new(bytes.Buffer)