diff --git a/providers/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/compute/config/VPDCComputeServiceContextModule.java b/providers/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/compute/config/VPDCComputeServiceContextModule.java index 26b3bc5e71..6a7cd4b9b6 100644 --- a/providers/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/compute/config/VPDCComputeServiceContextModule.java +++ b/providers/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/compute/config/VPDCComputeServiceContextModule.java @@ -33,13 +33,11 @@ import org.jclouds.savvis.vpdc.compute.functions.NetworkToLocation; import org.jclouds.savvis.vpdc.compute.functions.VMSpecToHardware; import org.jclouds.savvis.vpdc.compute.functions.VMToNodeMetadata; import org.jclouds.savvis.vpdc.compute.strategy.VPDCComputeServiceAdapter; -import org.jclouds.savvis.vpdc.compute.suppliers.FirstNetwork; import org.jclouds.savvis.vpdc.domain.Network; import org.jclouds.savvis.vpdc.domain.VM; import org.jclouds.savvis.vpdc.domain.VMSpec; import com.google.common.base.Function; -import com.google.common.base.Supplier; import com.google.inject.Injector; import com.google.inject.TypeLiteral; @@ -72,7 +70,7 @@ public class VPDCComputeServiceContextModule extends }).to(VMSpecToHardware.class); bind(new TypeLiteral>() { }).to(NetworkToLocation.class); - bind(new TypeLiteral>() { - }).to(FirstNetwork.class); + // to have the compute service adapter override default locations + install(new LocationsFromComputeServiceAdapterModule(){}); } } diff --git a/providers/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/config/VPDCRestClientModule.java b/providers/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/config/VPDCRestClientModule.java index 89ce7da565..77e61b3c29 100644 --- a/providers/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/config/VPDCRestClientModule.java +++ b/providers/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/config/VPDCRestClientModule.java @@ -41,6 +41,7 @@ import org.jclouds.http.annotation.Redirection; import org.jclouds.http.annotation.ServerError; import org.jclouds.json.Json; import org.jclouds.location.Provider; +import org.jclouds.location.suppliers.ImplicitLocationSupplier; import org.jclouds.predicates.RetryablePredicate; import org.jclouds.rest.AsyncClientFactory; import org.jclouds.rest.AuthorizationException; @@ -61,6 +62,7 @@ import org.jclouds.savvis.vpdc.features.VMClient; import org.jclouds.savvis.vpdc.handlers.VPDCErrorHandler; import org.jclouds.savvis.vpdc.internal.LoginAsyncClient; import org.jclouds.savvis.vpdc.internal.VCloudToken; +import org.jclouds.savvis.vpdc.location.FirstNetwork; import org.jclouds.savvis.vpdc.predicates.TaskSuccess; import org.jclouds.util.Strings2; @@ -70,6 +72,7 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; import com.google.inject.Injector; import com.google.inject.Provides; +import com.google.inject.Scopes; import com.google.inject.TypeLiteral; /** @@ -163,5 +166,10 @@ public class VPDCRestClientModule extends RestClientModule { +public class FirstNetwork implements ImplicitLocationSupplier { @Singleton public static final class IsNetwork implements Predicate { @Override