Merge pull request #375 from justinsb/avoid_nil_pointer_if_no_openstack_image
builder/openstack: If no image is generated, just return nil
This commit is contained in:
commit
8abc6dd178
@ -112,6 +112,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 are no images, then just return
|
||||||
|
if _, ok := state.GetOk("image"); !ok {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
// Build the artifact and return it
|
// Build the artifact and return it
|
||||||
artifact := &Artifact{
|
artifact := &Artifact{
|
||||||
ImageId: state.Get("image").(string),
|
ImageId: state.Get("image").(string),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user