brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rich...@apache.org
Subject [1/2] git commit: fix for when a jclouds provider doesn't need an explicit endpoint
Date Fri, 13 Jun 2014 13:45:13 GMT
Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master b6512014a -> 8fb8a4a30


fix for when a jclouds provider doesn't need an explicit endpoint


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/1b5f4360
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/1b5f4360
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/1b5f4360

Branch: refs/heads/master
Commit: 1b5f43605d70a28703589d777a9d04e6d9b1a139
Parents: b651201
Author: Andrea Turli <andrea.turli@gmail.com>
Authored: Fri Jun 13 13:25:50 2014 +0200
Committer: Andrea Turli <andrea.turli@gmail.com>
Committed: Fri Jun 13 13:25:50 2014 +0200

----------------------------------------------------------------------
 .../JcloudsBlobStoreBasedObjectStore.java       | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/1b5f4360/locations/jclouds/src/main/java/brooklyn/entity/rebind/persister/jclouds/JcloudsBlobStoreBasedObjectStore.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/main/java/brooklyn/entity/rebind/persister/jclouds/JcloudsBlobStoreBasedObjectStore.java
b/locations/jclouds/src/main/java/brooklyn/entity/rebind/persister/jclouds/JcloudsBlobStoreBasedObjectStore.java
index 8a04bbe..6893847 100644
--- a/locations/jclouds/src/main/java/brooklyn/entity/rebind/persister/jclouds/JcloudsBlobStoreBasedObjectStore.java
+++ b/locations/jclouds/src/main/java/brooklyn/entity/rebind/persister/jclouds/JcloudsBlobStoreBasedObjectStore.java
@@ -13,6 +13,11 @@ import org.jclouds.blobstore.options.ListContainerOptions;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.base.Function;
+import com.google.common.base.Objects;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.FluentIterable;
+
 import brooklyn.config.BrooklynServerConfig;
 import brooklyn.entity.rebind.persister.PersistMode;
 import brooklyn.entity.rebind.persister.PersistenceObjectStore;
@@ -21,11 +26,7 @@ import brooklyn.location.cloud.CloudLocationConfig;
 import brooklyn.location.jclouds.JcloudsLocation;
 import brooklyn.management.ManagementContext;
 import brooklyn.util.exceptions.FatalConfigurationRuntimeException;
-
-import com.google.common.base.Function;
-import com.google.common.base.Objects;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.FluentIterable;
+import brooklyn.util.text.Strings;
 
 /**
  * @author Andrea Turli
@@ -71,10 +72,11 @@ public class JcloudsBlobStoreBasedObjectStore implements PersistenceObjectStore
             String provider = checkNotNull(location.getConfig(LocationConfigKeys.CLOUD_PROVIDER),
"provider must not be null");
             String endpoint = location.getConfig(CloudLocationConfig.CLOUD_ENDPOINT);
 
-            context = ContextBuilder.newBuilder(provider)
-                .credentials(identity, credential)
-                .endpoint(endpoint)
-                .buildView(BlobStoreContext.class);
+            ContextBuilder contextBuilder = ContextBuilder.newBuilder(provider).credentials(identity,
credential);
+            if (!Strings.isBlank(endpoint)) {
+                contextBuilder.endpoint(endpoint);
+            }
+            context = contextBuilder.buildView(BlobStoreContext.class);
      
             // TODO do we need to get location from region? can't see the jclouds API.
             // doesn't matter in some places because it's already in the endpoint


Mime
View raw message