Commit c1cfd1da authored by Rickard von Essen's avatar Rickard von Essen

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

Force LANG=C before appending rest of environment
parents a719c83d 32bb7457
...@@ -89,8 +89,8 @@ func (c *Communicator) UploadDir(dst string, src string, exclude []string) error ...@@ -89,8 +89,8 @@ func (c *Communicator) UploadDir(dst string, src string, exclude []string) error
var stderr bytes.Buffer var stderr bytes.Buffer
cmd := ShellCommand(cpCmd) cmd := ShellCommand(cpCmd)
cmd.Env = append(cmd.Env, os.Environ()...)
cmd.Env = append(cmd.Env, "LANG=C") cmd.Env = append(cmd.Env, "LANG=C")
cmd.Env = append(cmd.Env, os.Environ()...)
cmd.Stderr = &stderr cmd.Stderr = &stderr
err = cmd.Run() err = cmd.Run()
if err == nil { if err == nil {
......
...@@ -34,11 +34,10 @@ func (f *IfconfigIPFinder) HostIP() (string, error) { ...@@ -34,11 +34,10 @@ func (f *IfconfigIPFinder) HostIP() (string, error) {
stdout := new(bytes.Buffer) stdout := new(bytes.Buffer)
cmd := exec.Command(ifconfigPath, device) 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 // Force LANG=C so that the output is what we expect it to be
// despite the locale. // despite the locale.
cmd.Env = append(cmd.Env, "LANG=C") cmd.Env = append(cmd.Env, "LANG=C")
cmd.Env = append(cmd.Env, os.Environ()...)
cmd.Stdout = stdout cmd.Stdout = stdout
cmd.Stderr = new(bytes.Buffer) cmd.Stderr = new(bytes.Buffer)
......
...@@ -33,11 +33,10 @@ func (f *IfconfigIPFinder) HostIP() (string, error) { ...@@ -33,11 +33,10 @@ func (f *IfconfigIPFinder) HostIP() (string, error) {
stdout := new(bytes.Buffer) stdout := new(bytes.Buffer)
cmd := exec.Command(ifconfigPath, f.Device) 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 // Force LANG=C so that the output is what we expect it to be
// despite the locale. // despite the locale.
cmd.Env = append(cmd.Env, "LANG=C") cmd.Env = append(cmd.Env, "LANG=C")
cmd.Env = append(cmd.Env, os.Environ()...)
cmd.Stdout = stdout cmd.Stdout = stdout
cmd.Stderr = new(bytes.Buffer) cmd.Stderr = new(bytes.Buffer)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment