Fix to allow equals sign in value of environment variable
This commit is contained in:
parent
be0196492f
commit
0423f91037
|
@ -347,7 +347,7 @@ func (p *Provisioner) createFlattenedEnvVars(elevated bool) (flattened string, e
|
||||||
|
|
||||||
// Split vars into key/value components
|
// Split vars into key/value components
|
||||||
for _, envVar := range p.config.Vars {
|
for _, envVar := range p.config.Vars {
|
||||||
keyValue := strings.Split(envVar, "=")
|
keyValue := strings.SplitN(envVar, "=", 2)
|
||||||
|
|
||||||
if len(keyValue) != 2 || keyValue[0] == "" {
|
if len(keyValue) != 2 || keyValue[0] == "" {
|
||||||
err = errors.New(fmt.Sprintf("Shell provisioner environment variables must be in key=value format. Currently it is '%s'", envVar))
|
err = errors.New(fmt.Sprintf("Shell provisioner environment variables must be in key=value format. Currently it is '%s'", envVar))
|
||||||
|
|
Loading…
Reference in New Issue