From 4622bb4585994ae4a3bfbefc69ebfb0a8b929c06 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Thu, 25 Jan 2018 16:29:24 -0800 Subject: [PATCH] return no artifact if no snapshot was created --- builder/oracle/classic/builder.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/builder/oracle/classic/builder.go b/builder/oracle/classic/builder.go index 7c682b875..9264e6466 100644 --- a/builder/oracle/classic/builder.go +++ b/builder/oracle/classic/builder.go @@ -92,6 +92,11 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe return nil, rawErr.(error) } + // If there is no snapshot, then just return + if _, ok := state.GetOk("snapshot"); !ok { + return nil, nil + } + // Build the artifact and return it artifact := &Artifact{ Snapshot: state.Get("snapshot").(*compute.Snapshot),