From b05129e52e5e42a391b5d2aff410eda33e105bc4 Mon Sep 17 00:00:00 2001 From: Michael Kuzmin Date: Thu, 15 May 2014 15:53:17 +0400 Subject: [PATCH 1/2] post-processor/vsphere: logging for upload parameters --- post-processor/vsphere/post-processor.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/post-processor/vsphere/post-processor.go b/post-processor/vsphere/post-processor.go index c120cad70..8dbdb887e 100644 --- a/post-processor/vsphere/post-processor.go +++ b/post-processor/vsphere/post-processor.go @@ -3,6 +3,7 @@ package vsphere import ( "bytes" "fmt" + "log" "github.com/mitchellh/packer/common" "github.com/mitchellh/packer/packer" "os/exec" @@ -137,6 +138,7 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac ui.Message(fmt.Sprintf("Uploading %s to vSphere", vmx)) var out bytes.Buffer + log.Printf("Starting ovftool with parameters: %s", strings.Join(args, " ")) cmd := exec.Command("ovftool", args...) cmd.Stdout = &out if err := cmd.Run(); err != nil { From 2dd538ced857ef83921b37c571a83a9104fd7be5 Mon Sep 17 00:00:00 2001 From: Michael Kuzmin Date: Thu, 15 May 2014 16:04:27 +0400 Subject: [PATCH 2/2] post-processor/vsphere: url-escape username to accept DOMAIN\account values --- post-processor/vsphere/post-processor.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/post-processor/vsphere/post-processor.go b/post-processor/vsphere/post-processor.go index 8dbdb887e..7827494bd 100644 --- a/post-processor/vsphere/post-processor.go +++ b/post-processor/vsphere/post-processor.go @@ -8,6 +8,7 @@ import ( "github.com/mitchellh/packer/packer" "os/exec" "strings" + "net/url" ) var builtins = map[string]string{ @@ -128,7 +129,7 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac fmt.Sprintf("--vmFolder=%s", p.config.VMFolder), fmt.Sprintf("%s", vmx), fmt.Sprintf("vi://%s:%s@%s/%s/host/%s/Resources/%s", - p.config.Username, + url.QueryEscape(p.config.Username), p.config.Password, p.config.Host, p.config.Datacenter,