From a530b5b5d69815310559a24d716f68de3ecda3d9 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Sun, 27 Nov 2011 11:13:55 -0500 Subject: [PATCH] fixed bad state in cloudstack when node is stopped --- .../compute/functions/VirtualMachineToNodeMetadata.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/functions/VirtualMachineToNodeMetadata.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/functions/VirtualMachineToNodeMetadata.java index e7cd005e15..54eebb3759 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/functions/VirtualMachineToNodeMetadata.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/functions/VirtualMachineToNodeMetadata.java @@ -30,8 +30,6 @@ import javax.annotation.Nullable; import javax.inject.Inject; import javax.inject.Singleton; -import com.google.common.base.Predicate; -import com.google.common.collect.Iterables; import org.jclouds.cloudstack.domain.IPForwardingRule; import org.jclouds.cloudstack.domain.VirtualMachine; import org.jclouds.collect.FindResourceInSet; @@ -47,6 +45,7 @@ import org.jclouds.util.InetAddresses2; import org.jclouds.util.Throwables2; import com.google.common.base.Function; +import com.google.common.base.Predicate; import com.google.common.base.Supplier; import com.google.common.base.Throwables; import com.google.common.cache.Cache; @@ -62,8 +61,8 @@ public class VirtualMachineToNodeMetadata implements Function vmStateToNodeState = ImmutableMap .builder().put(VirtualMachine.State.STARTING, NodeState.PENDING) - .put(VirtualMachine.State.RUNNING, NodeState.RUNNING).put(VirtualMachine.State.STOPPING, NodeState.SUSPENDED) - .put(VirtualMachine.State.STOPPED, NodeState.PENDING) + .put(VirtualMachine.State.RUNNING, NodeState.RUNNING).put(VirtualMachine.State.STOPPING, NodeState.PENDING) + .put(VirtualMachine.State.STOPPED, NodeState.SUSPENDED) .put(VirtualMachine.State.DESTROYED, NodeState.TERMINATED) .put(VirtualMachine.State.EXPUNGING, NodeState.TERMINATED) .put(VirtualMachine.State.MIGRATING, NodeState.PENDING).put(VirtualMachine.State.ERROR, NodeState.ERROR)