From a099e32df2e6f861d4e4b0e2580d9a36289c338c Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 4 Jun 2013 11:26:08 -0700 Subject: [PATCH] builder/amazonebs: Handle case where no AMIs --- builder/amazonebs/builder.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/builder/amazonebs/builder.go b/builder/amazonebs/builder.go index 577506c83..6bdda51b4 100644 --- a/builder/amazonebs/builder.go +++ b/builder/amazonebs/builder.go @@ -102,12 +102,9 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook) packer.Artifact { b.runner = &multistep.BasicRunner{Steps: steps} b.runner.Run(state) - // If we were cancelled, then return no artifacts - if raw, ok := state["cancelled"]; ok { - cancelled := raw.(bool) - if cancelled { - return nil - } + // If there are no AMIs, then jsut return + if _, ok := state["amis"]; !ok { + return nil } // Build the artifact and return it