Commit ec41edf5 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

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

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