Commit f67fdeca authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/amazonebs: If cancelled, don't return artifact

parent 5aa78cb4
......@@ -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)}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment