From 5e6ddec8746a9228dfa622e83e279a4db4d0cb61 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Fri, 9 Mar 2012 10:53:54 -0800 Subject: [PATCH] nasty regression in state found by aled --- .../compute/config/ComputeServiceTimeoutsModule.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compute/src/main/java/org/jclouds/compute/config/ComputeServiceTimeoutsModule.java b/compute/src/main/java/org/jclouds/compute/config/ComputeServiceTimeoutsModule.java index 9c76083805..ee4cf88df9 100644 --- a/compute/src/main/java/org/jclouds/compute/config/ComputeServiceTimeoutsModule.java +++ b/compute/src/main/java/org/jclouds/compute/config/ComputeServiceTimeoutsModule.java @@ -27,10 +27,12 @@ import javax.inject.Singleton; import org.jclouds.compute.domain.NodeMetadata; import org.jclouds.compute.predicates.AtomicNodeRunning; +import org.jclouds.compute.predicates.AtomicNodeSuspended; import org.jclouds.compute.predicates.NodeRunning; import org.jclouds.compute.predicates.NodeSuspended; import org.jclouds.compute.predicates.NodeTerminated; import org.jclouds.compute.predicates.ScriptStatusReturnsZero; +import org.jclouds.compute.predicates.TrueIfNullOrTerminatedRefreshAndDoubleCheckOnFalse; import org.jclouds.compute.predicates.ScriptStatusReturnsZero.CommandUsingClient; import org.jclouds.compute.reference.ComputeServiceConstants.Timeouts; import org.jclouds.predicates.RetryablePredicate; @@ -57,7 +59,7 @@ public class ComputeServiceTimeoutsModule extends AbstractModule { @Provides @Singleton @Named("NODE_TERMINATED") - protected Predicate> serverTerminated(AtomicNodeRunning stateTerminated, Timeouts timeouts) { + protected Predicate> serverTerminated(TrueIfNullOrTerminatedRefreshAndDoubleCheckOnFalse stateTerminated, Timeouts timeouts) { return timeouts.nodeTerminated == 0 ? stateTerminated : new RetryablePredicate>(stateTerminated, timeouts.nodeTerminated); } @@ -66,7 +68,7 @@ public class ComputeServiceTimeoutsModule extends AbstractModule { @Provides @Singleton @Named("NODE_SUSPENDED") - protected Predicate> serverSuspended(AtomicNodeRunning stateSuspended, Timeouts timeouts) { + protected Predicate> serverSuspended(AtomicNodeSuspended stateSuspended, Timeouts timeouts) { return timeouts.nodeSuspended == 0 ? stateSuspended : new RetryablePredicate>(stateSuspended, timeouts.nodeSuspended); }