provisioner/shell: Split on first equal for env vars [GH-1045]

This commit is contained in:
Mitchell Hashimoto 2014-04-26 14:51:56 -07:00
parent a0ae1a1174
commit ec41edf558
1 changed files with 1 additions and 1 deletions

View File

@ -171,7 +171,7 @@ func (p *Provisioner) Prepare(raws ...interface{}) error {
// Do a check for bad environment variables, such as '=foo', 'foobar' // Do a check for bad environment variables, such as '=foo', 'foobar'
for _, kv := range p.config.Vars { for _, kv := range p.config.Vars {
vs := strings.Split(kv, "=") vs := strings.SplitN(kv, "=", 2)
if len(vs) != 2 || vs[0] == "" { if len(vs) != 2 || vs[0] == "" {
errs = packer.MultiErrorAppend(errs, errs = packer.MultiErrorAppend(errs,
fmt.Errorf("Environment variable not in format 'key=value': %s", kv)) fmt.Errorf("Environment variable not in format 'key=value': %s", kv))