return no artifact if no snapshot was created
This commit is contained in:
parent
dbf5d52c43
commit
4622bb4585
|
@ -92,6 +92,11 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
|
||||||
return nil, rawErr.(error)
|
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
|
// Build the artifact and return it
|
||||||
artifact := &Artifact{
|
artifact := &Artifact{
|
||||||
Snapshot: state.Get("snapshot").(*compute.Snapshot),
|
Snapshot: state.Get("snapshot").(*compute.Snapshot),
|
||||||
|
|
Loading…
Reference in New Issue