Only use running state for checking if instance is alive. (#1885)

Fixes #1884
This commit is contained in:
Jeff Mitchell 2016-09-13 18:08:05 -04:00 committed by GitHub
parent c364ac823b
commit 29b67141eb

View file

@ -83,8 +83,7 @@ func (b *backend) validateInstance(s logical.Storage, instanceID, region string)
if status.Reservations[0].Instances[0].State == nil { if status.Reservations[0].Instances[0].State == nil {
return nil, fmt.Errorf("instance state in instance description is nil") return nil, fmt.Errorf("instance state in instance description is nil")
} }
if *status.Reservations[0].Instances[0].State.Code != 16 || if *status.Reservations[0].Instances[0].State.Name != "running" {
*status.Reservations[0].Instances[0].State.Name != "running" {
return nil, fmt.Errorf("instance is not in 'running' state") return nil, fmt.Errorf("instance is not in 'running' state")
} }
return status, nil return status, nil