public void WaitForInstancesStatus(IEnumerable <string> instanceIds, Ec2InstanceState state) { Thread.Sleep(15000); var instances = GetInstances(instanceIds).ToList(); var states = instances.Select(y => y.State); if (states.Any(x => x.Code != (int)state)) { Logger.Info("One or more instances is not in state {0}, waiting 15 seconds...", state.ToString()); WaitForInstancesStatus(instanceIds, state); } }
public void WaitForInstancesStatus(IEnumerable<string> instanceIds, Ec2InstanceState state) { var instances = GetInstances(instanceIds).ToList(); var states = instances.Select(y => y.State); if (states.Any(x => x.Code != (int)state)) { Logger.Info("One or more instances is not in state {0}, waiting 15 seconds...", state.ToString()); Thread.Sleep(15000); WaitForInstancesStatus(instanceIds, state); } }