Force LANG=C before appending rest of environment, as only first occurence is used
This commit is contained in:
parent
a719c83dc8
commit
32bb745734
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue