Repository: brooklyn-server
Updated Branches:
  refs/heads/master b9f14e556 -> 5827932c2


Modify jcloudsLocation.releaseNode

- from destroyNode to destroyNodesMatchingId as it calls consistently 
cleanUpIncidentalResourcesOfDeadNodes


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/53c0d440
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/53c0d440
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/53c0d440

Branch: refs/heads/master
Commit: 53c0d4408270a2aafab803c8e8ff5300f3fa38e9
Parents: 2c3e33b
Author: Andrea Turli <[email protected]>
Authored: Fri Aug 25 17:58:45 2017 +0200
Committer: Andrea Turli <[email protected]>
Committed: Fri Aug 25 18:00:30 2017 +0200

----------------------------------------------------------------------
 .../apache/brooklyn/location/jclouds/JcloudsLocation.java   | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/53c0d440/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
----------------------------------------------------------------------
diff --git 
a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
 
b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
index e975520..8d32b2f 100644
--- 
a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
+++ 
b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
@@ -23,6 +23,7 @@ import static 
com.google.common.base.Preconditions.checkNotNull;
 import static org.apache.brooklyn.util.JavaGroovyEquivalents.elvis;
 import static org.apache.brooklyn.util.JavaGroovyEquivalents.groovyTruth;
 import static org.apache.brooklyn.util.ssh.BashCommands.sbinPath;
+import static org.jclouds.compute.predicates.NodePredicates.*;
 import static org.jclouds.util.Throwables2.getFirstThrowableOfType;
 
 import java.io.ByteArrayOutputStream;
@@ -145,6 +146,7 @@ import org.jclouds.compute.domain.OsFamily;
 import org.jclouds.compute.domain.Template;
 import org.jclouds.compute.domain.TemplateBuilder;
 import org.jclouds.compute.options.TemplateOptions;
+import org.jclouds.compute.predicates.NodePredicates;
 import org.jclouds.domain.Credentials;
 import org.jclouds.domain.LocationScope;
 import org.jclouds.domain.LoginCredentials;
@@ -2183,10 +2185,13 @@ public class JcloudsLocation extends 
AbstractCloudMachineProvisioningLocation im
     }
 
     protected void releaseNode(String instanceId) {
-        ComputeService computeService = null;
+        ComputeService computeService;
         try {
             computeService = getComputeService(config().getBag());
-            computeService.destroyNode(instanceId);
+            // FIXME revert to computeService.destroyNode(instanceId); once 
JCLOUDS-1332 gets fixed
+            Set<? extends NodeMetadata> destroyed = 
computeService.destroyNodesMatching(withIds(instanceId));
+            LOG.debug("Destroyed nodes %s%n", destroyed);
+
         } finally {
         /*
             // we don't close the compute service; this means if we provision 
add'l it is fast;

Reply via email to