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.
This commit is contained in:
Ryan Breed 2014-11-12 23:03:14 -06:00
parent ec216a52ef
commit 514b5f52f1
1 changed files with 1 additions and 1 deletions

View File

@ -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,