builder/vmware: force LANG=C for ifconfig [GH-592]

This commit is contained in:
Mitchell Hashimoto 2013-11-04 14:26:18 -08:00
parent 6c19ba621f
commit cf0ac15ecc
2 changed files with 7 additions and 0 deletions

View File

@ -22,6 +22,7 @@ BUG FIXES:
[GH-554]
* builder/openstack: Properly scrub password from logs [GH-554]
* builder/virtualbox: No panic if SSH host port min/max is the same. [GH-594]
* builder/vmware: Host IP lookup works for non-C locales. [GH-592]
* common/uuid: Use cryptographically secure PRNG when generating
UUIDs. [GH-552]
* communicator/ssh: File uploads that exceed the size of memory no longer

View File

@ -21,6 +21,12 @@ 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.Stdout = stdout
cmd.Stderr = new(bytes.Buffer)
if err := cmd.Run(); err != nil {