From 44329eceaf38f5b35ce9617e03f07ff6ea5daf7e Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Thu, 2 Feb 2012 07:38:06 -0800 Subject: [PATCH] slicehost related changes for Issue 826 --- .../config/SlicehostComputeServiceContextModule.java | 8 +------- .../strategy/SlicehostComputeServiceAdapter.java | 12 +++++------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/providers/slicehost/src/main/java/org/jclouds/slicehost/compute/config/SlicehostComputeServiceContextModule.java b/providers/slicehost/src/main/java/org/jclouds/slicehost/compute/config/SlicehostComputeServiceContextModule.java index 73f547d896..c08a56afa6 100644 --- a/providers/slicehost/src/main/java/org/jclouds/slicehost/compute/config/SlicehostComputeServiceContextModule.java +++ b/providers/slicehost/src/main/java/org/jclouds/slicehost/compute/config/SlicehostComputeServiceContextModule.java @@ -35,7 +35,6 @@ import org.jclouds.compute.domain.TemplateBuilder; import org.jclouds.compute.internal.BaseComputeService; import org.jclouds.domain.Location; import org.jclouds.functions.IdentityFunction; -import org.jclouds.location.suppliers.OnlyLocationOrFirstZone; import org.jclouds.slicehost.SlicehostAsyncClient; import org.jclouds.slicehost.SlicehostClient; import org.jclouds.slicehost.compute.functions.FlavorToHardware; @@ -48,7 +47,6 @@ import org.jclouds.slicehost.domain.Slice; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Function; -import com.google.common.base.Supplier; import com.google.common.collect.ImmutableMap; import com.google.inject.Injector; import com.google.inject.Provides; @@ -88,12 +86,8 @@ public class SlicehostComputeServiceContextModule bind(new TypeLiteral>() { }).to((Class) IdentityFunction.class); - // there are no locations except the provider - bind(new TypeLiteral>() { - }).to(OnlyLocationOrFirstZone.class); - } - + @Override protected TemplateBuilder provideTemplate(Injector injector, TemplateBuilder template) { return template.osFamily(UBUNTU).osVersionMatches("1[10].[10][04]").osDescriptionMatches("^((?!MGC).)*$") diff --git a/providers/slicehost/src/main/java/org/jclouds/slicehost/compute/strategy/SlicehostComputeServiceAdapter.java b/providers/slicehost/src/main/java/org/jclouds/slicehost/compute/strategy/SlicehostComputeServiceAdapter.java index 34fe05e4a8..e83b28ba70 100644 --- a/providers/slicehost/src/main/java/org/jclouds/slicehost/compute/strategy/SlicehostComputeServiceAdapter.java +++ b/providers/slicehost/src/main/java/org/jclouds/slicehost/compute/strategy/SlicehostComputeServiceAdapter.java @@ -28,12 +28,13 @@ import org.jclouds.compute.ComputeServiceAdapter; import org.jclouds.compute.domain.Template; import org.jclouds.domain.Location; import org.jclouds.domain.LoginCredentials; -import org.jclouds.location.suppliers.JustProvider; import org.jclouds.slicehost.SlicehostClient; import org.jclouds.slicehost.domain.Flavor; import org.jclouds.slicehost.domain.Image; import org.jclouds.slicehost.domain.Slice; +import com.google.common.collect.ImmutableSet; + /** * defines the connection between the {@link SlicehostClient} implementation and the jclouds * {@link ComputeService} @@ -43,13 +44,10 @@ import org.jclouds.slicehost.domain.Slice; public class SlicehostComputeServiceAdapter implements ComputeServiceAdapter { protected final SlicehostClient client; - protected final JustProvider locationSupplier; @Inject - protected SlicehostComputeServiceAdapter(SlicehostClient client, JustProvider locationSupplier) { + protected SlicehostComputeServiceAdapter(SlicehostClient client) { this.client = checkNotNull(client, "client"); - this.locationSupplier = checkNotNull(locationSupplier, "locationSupplier"); - } @Override @@ -79,10 +77,10 @@ public class SlicehostComputeServiceAdapter implements ComputeServiceAdapter listLocations() { - return (Iterable) locationSupplier.get(); + // Not using the adapter to determine locations + return ImmutableSet.of(); } @Override