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
1 changed files with 1 additions and 2 deletions

View File

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