Only use running state for checking if instance is alive. (#1885)
Fixes #1884
This commit is contained in:
parent
c364ac823b
commit
29b67141eb
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue