Commit 0f39a445 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

Merge pull request #228 from markpeek/markpeek-images

builder/amazon/common: handle missing source AMI error
parents 55802746 1aec0d6a
......@@ -41,6 +41,10 @@ func (s *StepRunSourceInstance) Run(state map[string]interface{}) multistep.Step
state["error"] = fmt.Errorf("There was a problem with the source AMI: %s", err)
return multistep.ActionHalt
}
if len(imageResp.Images) != 1 {
state["error"] = fmt.Errorf("The source AMI '%s' could not be found.", s.SourceAMI)
return multistep.ActionHalt
}
if s.ExpectedRootDevice != "" && imageResp.Images[0].RootDeviceType != s.ExpectedRootDevice {
state["error"] = fmt.Errorf(
......
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