From b42c916f9a22addac0fa2683d3e06fffcd26f294 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Tue, 26 Sep 2017 13:36:53 -0700 Subject: [PATCH] cloudstack: check that template was created --- builder/cloudstack/builder.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/builder/cloudstack/builder.go b/builder/cloudstack/builder.go index 5c82e3188..27af37d17 100644 --- a/builder/cloudstack/builder.go +++ b/builder/cloudstack/builder.go @@ -102,6 +102,11 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe return nil, rawErr.(error) } + // If there was no template created, just return + if _, ok := state.GetOk("template"); !ok { + return nil, nil + } + // Build the artifact and return it artifact := &Artifact{ client: client,