Merge pull request #4308 from rickard-von-essen/issue-4303

builder/amazon: Crashes when multiple EBS vols are used
This commit is contained in:
Rickard von Essen 2016-12-21 15:45:58 +01:00 committed by GitHub
commit 133af90774
1 changed files with 2 additions and 1 deletions

View File

@ -68,7 +68,8 @@ func (s *stepCreateAMI) Run(state multistep.StateBag) multistep.StepAction {
snapshots := make(map[string][]string)
for _, blockDeviceMapping := range imagesResp.Images[0].BlockDeviceMappings {
if blockDeviceMapping.Ebs != nil {
if blockDeviceMapping.Ebs != nil && blockDeviceMapping.Ebs.SnapshotId != nil {
snapshots[*ec2conn.Config.Region] = append(snapshots[*ec2conn.Config.Region], *blockDeviceMapping.Ebs.SnapshotId)
}
}