Merge pull request #6962 from hashicorp/fix_6940

escape vSphere username when putting it into the query
This commit is contained in:
Megan Marsh 2018-11-13 10:15:25 -08:00 committed by GitHub
commit dca02c7b07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -40,6 +40,8 @@ func GetOVFTool() string {
func (s *StepExport) generateArgs(c *DriverConfig, displayName string, hidePassword bool) []string {
password := url.QueryEscape(c.RemotePassword)
username := url.QueryEscape(c.RemoteUser)
if hidePassword {
password = "****"
}
@ -48,7 +50,7 @@ func (s *StepExport) generateArgs(c *DriverConfig, displayName string, hidePassw
"--skipManifestCheck",
"-tt=" + s.Format,
"vi://" + c.RemoteUser + ":" + password + "@" + c.RemoteHost + "/" + displayName,
"vi://" + username + ":" + password + "@" + c.RemoteHost + "/" + displayName,
s.OutputDir,
}
return append(s.OVFToolOptions, args...)