From 489777e872551cce394c05868e4b0aee3f9f6967 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Tue, 20 Mar 2012 11:35:49 -0700 Subject: [PATCH] Issue 878: cloudstack locations are zones, not regions --- .../config/CloudStackRestClientModule.java | 44 ++++++++++++------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackRestClientModule.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackRestClientModule.java index 6cbdbbe730..e4e7336a7f 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackRestClientModule.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackRestClientModule.java @@ -18,17 +18,13 @@ */ package org.jclouds.cloudstack.config; -import com.google.common.base.Function; -import com.google.common.base.Supplier; -import com.google.common.cache.CacheBuilder; -import com.google.common.cache.CacheLoader; -import com.google.common.cache.LoadingCache; -import com.google.common.collect.ImmutableMap; -import com.google.inject.Inject; -import com.google.inject.Provides; -import com.google.inject.Singleton; -import com.google.inject.TypeLiteral; -import com.google.inject.name.Named; +import static com.google.common.base.Throwables.propagate; +import static org.jclouds.rest.config.BinderUtils.bindClientAndAsyncClient; + +import java.util.Map; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; + import org.jclouds.Constants; import org.jclouds.cloudstack.CloudStackAsyncClient; import org.jclouds.cloudstack.CloudStackClient; @@ -133,18 +129,26 @@ import org.jclouds.http.annotation.Redirection; import org.jclouds.http.annotation.ServerError; import org.jclouds.json.config.GsonModule.DateAdapter; import org.jclouds.location.Provider; +import org.jclouds.location.suppliers.ImplicitLocationSupplier; +import org.jclouds.location.suppliers.implicit.OnlyLocationOrFirstZone; import org.jclouds.rest.ConfiguresRestClient; import org.jclouds.rest.RestContext; import org.jclouds.rest.config.BinderUtils; import org.jclouds.rest.config.RestClientModule; import org.jclouds.rest.internal.RestContextImpl; -import java.util.Map; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; - -import static com.google.common.base.Throwables.propagate; -import static org.jclouds.rest.config.BinderUtils.bindClientAndAsyncClient; +import com.google.common.base.Function; +import com.google.common.base.Supplier; +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import com.google.common.collect.ImmutableMap; +import com.google.inject.Inject; +import com.google.inject.Provides; +import com.google.inject.Scopes; +import com.google.inject.Singleton; +import com.google.inject.TypeLiteral; +import com.google.inject.name.Named; /** * Configures the cloudstack connection. @@ -241,6 +245,12 @@ public class CloudStackRestClientModule extends RestClientModule