Merge pull request #2646 from hashicorp/b-aws-error-root-device

provider/aws: Error when unable to find a Root Block Device name
This commit is contained in:
Clint 2015-07-27 12:21:42 -05:00
commit b3ac87ed19
1 changed files with 4 additions and 0 deletions

View File

@ -778,6 +778,10 @@ func fetchRootDeviceName(ami string, conn *ec2.EC2) (*string, error) {
rootDeviceName = image.BlockDeviceMappings[0].DeviceName rootDeviceName = image.BlockDeviceMappings[0].DeviceName
} }
if rootDeviceName == nil {
return nil, fmt.Errorf("[WARN] Error finding Root Device Name for AMI (%s)", ami)
}
return rootDeviceName, nil return rootDeviceName, nil
} }