From b787d6fb1dde1a4455ee6c8377262a3c3aea1e5a Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 18 Nov 2013 16:10:55 -0800 Subject: [PATCH] builder/vmware: ESX artifacts have a different builder ID This is so that things like vagrant post-processors and vsphere post processors don't work. --- builder/vmware/artifact.go | 9 +++++---- builder/vmware/builder.go | 13 ++++++++++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/builder/vmware/artifact.go b/builder/vmware/artifact.go index 379b969b2..7e6fddb92 100644 --- a/builder/vmware/artifact.go +++ b/builder/vmware/artifact.go @@ -8,12 +8,13 @@ import ( // Artifact is the result of running the VMware builder, namely a set // of files associated with the resulting machine. type Artifact struct { - dir string - f []string + builderId string + dir string + f []string } -func (*Artifact) BuilderId() string { - return BuilderId +func (a *Artifact) BuilderId() string { + return a.builderId } func (a *Artifact) Files() []string { diff --git a/builder/vmware/builder.go b/builder/vmware/builder.go index 4d76a2b57..a9fe6c6b9 100644 --- a/builder/vmware/builder.go +++ b/builder/vmware/builder.go @@ -16,6 +16,7 @@ import ( ) const BuilderId = "mitchellh.vmware" +const BuilderIdESX = "mitchellh.vmware-esx" type Builder struct { config config @@ -463,7 +464,17 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe return nil, err } - return &Artifact{b.config.OutputDir, files}, nil + // Set the proper builder ID + builderId := BuilderId + if b.config.RemoteType != "" { + builderId = BuilderIdESX + } + + return &Artifact{ + builderId: builderId, + dir: b.config.OutputDir, + f: files, + }, nil } func (b *Builder) Cancel() {