mirror of
https://github.com/hashicorp/packer.git
synced 2026-10-11 17:01:56 -04:00
builder/amazonebs: If cancelled, don't return artifact
This commit is contained in:
@@ -102,6 +102,14 @@ 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
|
||||
}
|
||||
}
|
||||
|
||||
// Build the artifact and return it
|
||||
return &artifact{state["amis"].(map[string]string)}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user