From 5a177e9c7665e6f27f7cb0f473d4f951607b3c2f Mon Sep 17 00:00:00 2001 From: andreaturli Date: Wed, 10 Nov 2010 21:43:06 +0100 Subject: [PATCH] destroy() implemented --- .../domain/LibvirtComputeServiceContextModule.java | 5 +++++ .../strategy/LibvirtComputeServiceAdapter.java | 12 ------------ .../libvirt/compute/LibvirtExperimentLiveTest.java | 5 ++--- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/sandbox/libvirt/src/main/java/org/jclouds/libvirt/compute/domain/LibvirtComputeServiceContextModule.java b/sandbox/libvirt/src/main/java/org/jclouds/libvirt/compute/domain/LibvirtComputeServiceContextModule.java index 85a29f2f60..25d1a2cb03 100644 --- a/sandbox/libvirt/src/main/java/org/jclouds/libvirt/compute/domain/LibvirtComputeServiceContextModule.java +++ b/sandbox/libvirt/src/main/java/org/jclouds/libvirt/compute/domain/LibvirtComputeServiceContextModule.java @@ -25,15 +25,18 @@ import javax.inject.Named; import javax.inject.Singleton; import org.jclouds.Constants; +import org.jclouds.compute.ComputeService; import org.jclouds.compute.ComputeServiceAdapter; import org.jclouds.compute.config.StandaloneComputeServiceContextModule; import org.jclouds.compute.domain.Hardware; import org.jclouds.compute.domain.NodeMetadata; import org.jclouds.compute.domain.TemplateBuilder; +import org.jclouds.compute.internal.BaseComputeService; import org.jclouds.compute.suppliers.DefaultLocationSupplier; import org.jclouds.domain.Location; import org.jclouds.libvirt.Datacenter; import org.jclouds.libvirt.Image; +import org.jclouds.libvirt.compute.LibvirtComputeService; import org.jclouds.libvirt.compute.functions.DatacenterToLocation; import org.jclouds.libvirt.compute.functions.DomainToHardware; import org.jclouds.libvirt.compute.functions.DomainToNodeMetadata; @@ -73,6 +76,8 @@ StandaloneComputeServiceContextModule { }).to(DomainToHardware.class); bind(new TypeLiteral>() { }).to(DatacenterToLocation.class); + + bind(ComputeService.class).to(LibvirtComputeService.class); } @Provides diff --git a/sandbox/libvirt/src/main/java/org/jclouds/libvirt/compute/strategy/LibvirtComputeServiceAdapter.java b/sandbox/libvirt/src/main/java/org/jclouds/libvirt/compute/strategy/LibvirtComputeServiceAdapter.java index 48c24ff301..c092e4ca20 100644 --- a/sandbox/libvirt/src/main/java/org/jclouds/libvirt/compute/strategy/LibvirtComputeServiceAdapter.java +++ b/sandbox/libvirt/src/main/java/org/jclouds/libvirt/compute/strategy/LibvirtComputeServiceAdapter.java @@ -174,18 +174,6 @@ public class LibvirtComputeServiceAdapter implements ComputeServiceAdapter nodeMetadataSet = context.getComputeService().runNodesWithTag("tty", 1); for (NodeMetadata nodeMetadata : nodeMetadataSet) { - + /* context.getComputeService().suspendNode(nodeMetadata.getId()); context.getComputeService().resumeNode(nodeMetadata.getId()); - - // TODO seems that destroy is intended to be a force shutoff, not a delete VM ... + */ context.getComputeService().destroyNode(nodeMetadata.getId()); } } catch (Exception e) {