Merge pull request #228 from markpeek/markpeek-images
builder/amazon/common: handle missing source AMI error
This commit is contained in:
commit
0f39a4451c
|
@ -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)
|
state["error"] = fmt.Errorf("There was a problem with the source AMI: %s", err)
|
||||||
return multistep.ActionHalt
|
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 {
|
if s.ExpectedRootDevice != "" && imageResp.Images[0].RootDeviceType != s.ExpectedRootDevice {
|
||||||
state["error"] = fmt.Errorf(
|
state["error"] = fmt.Errorf(
|
||||||
|
|
Loading…
Reference in New Issue