Commit 514b5f52 authored by Ryan Breed's avatar Ryan Breed

consistent escaping for ovftool uri creds

I got thrown for a loop since the username is uri-escaped but the password was not.

I got thrown for another couple of loops due to the multiple levels of interpretation involved:
1) JSON syntax requires backslashes to be slash-escaped. Some vCenter deployments use windows domain-style usernames DOMAIN\user
2) the OVFTOOL docs specify that "all special characters" be uri-encoded when part of the user name or password
3) different shell interpretations on windows/linux

I'd say escape both or neither.
parent ec216a52
......@@ -130,7 +130,7 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac
fmt.Sprintf("%s", vmx),
fmt.Sprintf("vi://%s:%s@%s/%s/host/%s/Resources/%s/",
url.QueryEscape(p.config.Username),
p.config.Password,
url.QueryEscape(p.config.Password),
p.config.Host,
p.config.Datacenter,
p.config.Cluster,
......
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