You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by al...@apache.org on 2015/03/18 12:07:04 UTC
[1/5] incubator-brooklyn git commit: Undo #19, fixed upstream
Repository: incubator-brooklyn
Updated Branches:
refs/heads/master e4b5f2428 -> 52a6c708f
Undo #19, fixed upstream
RetryOnRenew fixed in jclouds upstream:
* https://issues.apache.org/jira/browse/JCLOUDS-178
* https://issues.apache.org/jira/browse/JCLOUDS-589
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/0141dc91
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/0141dc91
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/0141dc91
Branch: refs/heads/master
Commit: 0141dc91f697c749040e7863ac6ae45fd06d3e67
Parents: e4b5f24
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Tue Feb 3 22:21:17 2015 +0200
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Tue Mar 17 22:02:44 2015 +0200
----------------------------------------------------------------------
.../JcloudsBlobStoreBasedObjectStore.java | 2 +-
.../brooklyn/location/jclouds/JcloudsUtil.java | 14 +-
.../jclouds/config/AlwaysRetryOnRenew.java | 139 -------------------
.../persister/jclouds/BlobStoreExpiryTest.java | 28 +---
.../rebind/persister/jclouds/BlobStoreTest.java | 2 +-
.../jclouds/JcloudsExpect100ContinueTest.java | 3 +-
.../main/java/brooklyn/cli/CloudExplorer.java | 2 +-
7 files changed, 11 insertions(+), 179 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/0141dc91/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 6acaa97..60d7f1b 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
@@ -102,7 +102,7 @@ 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 = JcloudsUtil.newBlobstoreContext(provider, endpoint, identity, credential, true);
+ context = JcloudsUtil.newBlobstoreContext(provider, endpoint, identity, credential);
// 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
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/0141dc91/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsUtil.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsUtil.java b/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsUtil.java
index 4a304cb..eb0e605 100644
--- a/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsUtil.java
+++ b/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsUtil.java
@@ -65,9 +65,7 @@ import org.jclouds.util.Predicates2;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import brooklyn.entity.basic.Entities;
import brooklyn.entity.basic.Sanitizer;
-import brooklyn.location.jclouds.config.AlwaysRetryOnRenew;
import brooklyn.util.collections.MutableList;
import brooklyn.util.config.ConfigBag;
import brooklyn.util.exceptions.Exceptions;
@@ -266,10 +264,7 @@ public class JcloudsUtil implements JcloudsLocationConfig {
*
* @since 1.7.0 */
@Beta
- public static BlobStoreContext newBlobstoreContext(String provider, @Nullable String endpoint, String identity, String credential, boolean useSoftlayerFix) {
- AlwaysRetryOnRenew.InterceptRetryOnRenewModule fix =
- useSoftlayerFix ? new AlwaysRetryOnRenew.InterceptRetryOnRenewModule() : null;
-
+ public static BlobStoreContext newBlobstoreContext(String provider, @Nullable String endpoint, String identity, String credential) {
Properties overrides = new Properties();
// * Java 7,8 bug workaround - sockets closed by GC break the internal bookkeeping
// of HttpUrlConnection, leading to invalid handling of the "HTTP/1.1 100 Continue"
@@ -282,17 +277,12 @@ public class JcloudsUtil implements JcloudsLocationConfig {
overrides.setProperty(Constants.PROPERTY_STRIP_EXPECT_HEADER, "true");
ContextBuilder contextBuilder = ContextBuilder.newBuilder(provider).credentials(identity, credential);
- contextBuilder.modules(MutableList.copyOf(JcloudsUtil.getCommonModules())
- .appendIfNotNull(fix));
+ contextBuilder.modules(MutableList.copyOf(JcloudsUtil.getCommonModules()));
if (!brooklyn.util.text.Strings.isBlank(endpoint)) {
contextBuilder.endpoint(endpoint);
}
contextBuilder.overrides(overrides);
BlobStoreContext context = contextBuilder.buildView(BlobStoreContext.class);
-
- if (useSoftlayerFix)
- fix.inject(context.utils().injector());
-
return context;
}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/0141dc91/locations/jclouds/src/main/java/brooklyn/location/jclouds/config/AlwaysRetryOnRenew.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/main/java/brooklyn/location/jclouds/config/AlwaysRetryOnRenew.java b/locations/jclouds/src/main/java/brooklyn/location/jclouds/config/AlwaysRetryOnRenew.java
deleted file mode 100644
index 25580df..0000000
--- a/locations/jclouds/src/main/java/brooklyn/location/jclouds/config/AlwaysRetryOnRenew.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package brooklyn.location.jclouds.config;
-
-import static org.jclouds.http.HttpUtils.closeClientButKeepContentStream;
-import static org.jclouds.http.HttpUtils.releasePayload;
-
-import java.lang.reflect.Method;
-
-import javax.annotation.Resource;
-
-import org.aopalliance.intercept.MethodInterceptor;
-import org.aopalliance.intercept.MethodInvocation;
-import org.jclouds.domain.Credentials;
-import org.jclouds.http.HttpCommand;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.HttpRetryHandler;
-import org.jclouds.logging.Logger;
-import org.jclouds.openstack.domain.AuthenticationResponse;
-import org.jclouds.openstack.handlers.RetryOnRenew;
-import org.jclouds.openstack.reference.AuthHeaders;
-
-import com.google.common.annotations.Beta;
-import com.google.common.cache.LoadingCache;
-import com.google.common.collect.Multimap;
-import com.google.inject.AbstractModule;
-import com.google.inject.Inject;
-import com.google.inject.Injector;
-import com.google.inject.Singleton;
-import com.google.inject.matcher.AbstractMatcher;
-import com.google.inject.matcher.Matcher;
-import com.google.inject.matcher.Matchers;
-
-/** Fix for RetryOnRenew so that it always retries on 401 when using a token.
- * The "lease renew" text is not necessarily returned from swift servers.
- * <p>
- * See https://issues.apache.org/jira/browse/BROOKLYN-6 .
- * When https://issues.apache.org/jira/browse/JCLOUDS-615 is fixed in the jclouds we use,
- * we can remove this.
- * <p>
- * (Marked Beta as this will likely be removed.)
- *
- * @since 1.7.0 */
-@Beta
-@Singleton
-public class AlwaysRetryOnRenew implements HttpRetryHandler {
- @Resource
- protected Logger logger = Logger.NULL;
-
- private final LoadingCache<Credentials, AuthenticationResponse> authenticationResponseCache;
-
- @Inject
- protected AlwaysRetryOnRenew(LoadingCache<Credentials, AuthenticationResponse> authenticationResponseCache) {
- this.authenticationResponseCache = authenticationResponseCache;
- }
-
- @Override
- public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) {
- boolean retry = false; // default
- try {
- switch (response.getStatusCode()) {
- case 401:
- // Do not retry on 401 from authentication request
- Multimap<String, String> headers = command.getCurrentRequest().getHeaders();
- if (headers != null && headers.containsKey(AuthHeaders.AUTH_USER)
- && headers.containsKey(AuthHeaders.AUTH_KEY) && !headers.containsKey(AuthHeaders.AUTH_TOKEN)) {
- retry = false;
- } else {
- closeClientButKeepContentStream(response);
- authenticationResponseCache.invalidateAll();
- retry = true;
-
- // always retry. not all swift servers say 'lease renew', e.g. softlayer
-
-// byte[] content = closeClientButKeepContentStream(response);
-// if (content != null && new String(content).contains("lease renew")) {
-// logger.debug("invalidating authentication token");
-// authenticationResponseCache.invalidateAll();
-// retry = true;
-// } else {
-// retry = false;
-// }
- }
- break;
- }
- return retry;
-
- } finally {
- releasePayload(response);
- }
- }
-
- /**
- * Intercepts calls to the *other* RetryOnRenew instance, and uses the one above.
- * It's messy, but the only way I could find in the maze of guice. */
- public static class InterceptRetryOnRenewModule extends AbstractModule {
- AlwaysRetryOnRenew intereceptingRetryOnRenew;
-
- public void inject(Injector injector) {
- intereceptingRetryOnRenew = injector.getInstance(AlwaysRetryOnRenew.class);
- }
-
- @Override
- protected void configure() {
- Matcher<? super Class<?>> classMatcher = Matchers.subclassesOf(RetryOnRenew.class);
- Matcher<? super Method> methodMatcher = new AbstractMatcher<Method>() {
- @Override
- public boolean matches(Method t) {
- return "shouldRetryRequest".matches(t.getName());
- }
- };
- MethodInterceptor interceptors = new MethodInterceptor() {
- @Override
- public Object invoke(MethodInvocation invocation) throws Throwable {
- if (intereceptingRetryOnRenew==null)
- throw new IllegalStateException("inject() must be called to set up before use");
- return intereceptingRetryOnRenew.shouldRetryRequest((HttpCommand)invocation.getArguments()[0], (HttpResponse)invocation.getArguments()[1]);
- }
- };
- bindInterceptor(classMatcher, methodMatcher, interceptors);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/0141dc91/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/BlobStoreExpiryTest.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/BlobStoreExpiryTest.java b/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/BlobStoreExpiryTest.java
index 58eb2c3..76618a5 100644
--- a/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/BlobStoreExpiryTest.java
+++ b/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/BlobStoreExpiryTest.java
@@ -91,7 +91,7 @@ public class BlobStoreExpiryTest {
private String provider;
private String endpoint;
- public synchronized BlobStoreContext getBlobStoreContext(boolean applyFix) {
+ public synchronized BlobStoreContext getBlobStoreContext() {
if (context==null) {
if (location==null) {
Preconditions.checkNotNull(locationSpec, "locationSpec required for remote object store when location is null");
@@ -104,7 +104,7 @@ public class BlobStoreExpiryTest {
provider = checkNotNull(location.getConfig(LocationConfigKeys.CLOUD_PROVIDER), "provider must not be null");
endpoint = location.getConfig(CloudLocationConfig.CLOUD_ENDPOINT);
- context = JcloudsUtil.newBlobstoreContext(provider, endpoint, identity, credential, applyFix);
+ context = JcloudsUtil.newBlobstoreContext(provider, endpoint, identity, credential);
}
return context;
}
@@ -122,19 +122,12 @@ public class BlobStoreExpiryTest {
context = null;
}
- // test disabled as https://issues.apache.org/jira/browse/JCLOUDS-589 fixed the issue for Keystone greater than 1.1
- // the test would be applicable if pointed at a Swift endpoint that was using Keystone v1.1.
- @Test(enabled = false)
- public void testRenewAuthFailsInKeystoneV1_1() throws IOException {
- doTestRenewAuth(false);
- }
-
public void testRenewAuthSucceedsWithOurOverride() throws IOException {
- doTestRenewAuth(true);
+ doTestRenewAuth();
}
- protected void doTestRenewAuth(boolean applyFix) throws IOException {
- getBlobStoreContext(applyFix);
+ protected void doTestRenewAuth() throws IOException {
+ getBlobStoreContext();
injectShortLivedTokenForKeystoneV1_1();
@@ -146,17 +139,6 @@ public class BlobStoreExpiryTest {
Time.sleep(Duration.TEN_SECONDS);
- if (!applyFix) {
- // with the fix not applied, we have to invalidate the cache manually
- try {
- assertContainerFound();
- } catch (Exception e) {
- log.info("failed, as expected: "+e);
- }
- getAuthCache().invalidateAll();
- log.info("invalidated, should now succeed");
- }
-
assertContainerFound();
context.getBlobStore().deleteContainer(testContainerName);
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/0141dc91/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/BlobStoreTest.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/BlobStoreTest.java b/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/BlobStoreTest.java
index bad73e6..c01fa35 100644
--- a/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/BlobStoreTest.java
+++ b/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/BlobStoreTest.java
@@ -82,7 +82,7 @@ public class BlobStoreTest {
String provider = checkNotNull(location.getConfig(LocationConfigKeys.CLOUD_PROVIDER), "provider must not be null");
String endpoint = location.getConfig(CloudLocationConfig.CLOUD_ENDPOINT);
- context = JcloudsUtil.newBlobstoreContext(provider, endpoint, identity, credential, true);
+ context = JcloudsUtil.newBlobstoreContext(provider, endpoint, identity, credential);
}
return context;
}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/0141dc91/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/JcloudsExpect100ContinueTest.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/JcloudsExpect100ContinueTest.java b/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/JcloudsExpect100ContinueTest.java
index 1d5fbde..30cbfed 100644
--- a/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/JcloudsExpect100ContinueTest.java
+++ b/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/JcloudsExpect100ContinueTest.java
@@ -64,8 +64,7 @@ public class JcloudsExpect100ContinueTest {
jcloudsLocation.getProvider(),
jcloudsLocation.getEndpoint(),
jcloudsLocation.getIdentity(),
- jcloudsLocation.getCredential(),
- false);
+ jcloudsLocation.getCredential());
containerName = BlobStoreTest.CONTAINER_PREFIX+"-"+Identifiers.makeRandomId(8);
context.getBlobStore().createContainerInLocation(null, containerName);
}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/0141dc91/usage/cli/src/main/java/brooklyn/cli/CloudExplorer.java
----------------------------------------------------------------------
diff --git a/usage/cli/src/main/java/brooklyn/cli/CloudExplorer.java b/usage/cli/src/main/java/brooklyn/cli/CloudExplorer.java
index 3dd8462..17db6de 100644
--- a/usage/cli/src/main/java/brooklyn/cli/CloudExplorer.java
+++ b/usage/cli/src/main/java/brooklyn/cli/CloudExplorer.java
@@ -297,7 +297,7 @@ public class CloudExplorer {
String provider = checkNotNull(loc.getConfig(LocationConfigKeys.CLOUD_PROVIDER), "provider must not be null");
String endpoint = loc.getConfig(CloudLocationConfig.CLOUD_ENDPOINT);
- BlobStoreContext context = JcloudsUtil.newBlobstoreContext(provider, endpoint, identity, credential, true);
+ BlobStoreContext context = JcloudsUtil.newBlobstoreContext(provider, endpoint, identity, credential);
try {
BlobStore blobStore = context.getBlobStore();
doCall(blobStore, indent);
[5/5] incubator-brooklyn git commit: This closes #502
Posted by al...@apache.org.
This closes #502
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/52a6c708
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/52a6c708
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/52a6c708
Branch: refs/heads/master
Commit: 52a6c708fca8a83dcf0b3e0af8361fc900f7cff1
Parents: e4b5f24 7ca8b81
Author: Aled Sage <al...@gmail.com>
Authored: Wed Mar 18 11:06:24 2015 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Wed Mar 18 11:06:24 2015 +0000
----------------------------------------------------------------------
.../src/main/resources/logback-custom.xml | 28 ----
.../JcloudsBlobStoreBasedObjectStore.java | 2 +-
.../brooklyn/location/jclouds/JcloudsUtil.java | 16 +--
.../jclouds/config/AlwaysRetryOnRenew.java | 139 -------------------
.../persister/jclouds/BlobStoreExpiryTest.java | 48 +++----
.../rebind/persister/jclouds/BlobStoreTest.java | 2 +-
.../jclouds/JcloudsExpect100ContinueTest.java | 3 +-
.../main/java/brooklyn/cli/CloudExplorer.java | 2 +-
8 files changed, 23 insertions(+), 217 deletions(-)
----------------------------------------------------------------------
[4/5] incubator-brooklyn git commit: Explicitly state that the test
is for swift object store.
Posted by al...@apache.org.
Explicitly state that the test is for swift object store.
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/7ca8b81e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/7ca8b81e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/7ca8b81e
Branch: refs/heads/master
Commit: 7ca8b81eef82d4ad9d5be4b237637e49a7d534b6
Parents: b9e2ef7
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Tue Mar 17 22:18:56 2015 +0200
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Tue Mar 17 22:18:56 2015 +0200
----------------------------------------------------------------------
.../entity/rebind/persister/jclouds/BlobStoreExpiryTest.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/7ca8b81e/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/BlobStoreExpiryTest.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/BlobStoreExpiryTest.java b/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/BlobStoreExpiryTest.java
index 3d98d20..e753a18 100644
--- a/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/BlobStoreExpiryTest.java
+++ b/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/BlobStoreExpiryTest.java
@@ -91,7 +91,7 @@ public class BlobStoreExpiryTest {
private String provider;
private String endpoint;
- public synchronized BlobStoreContext getBlobStoreContext() {
+ public synchronized BlobStoreContext getSwiftBlobStoreContext() {
if (context==null) {
if (location==null) {
Preconditions.checkNotNull(locationSpec, "locationSpec required for remote object store when location is null");
@@ -122,12 +122,12 @@ public class BlobStoreExpiryTest {
context = null;
}
- public void testRenewAuthSucceeds() throws Exception {
+ public void testRenewAuthSucceedsInSwiftObjectStore() throws Exception {
doTestRenewAuth();
}
protected void doTestRenewAuth() throws Exception {
- getBlobStoreContext();
+ getSwiftBlobStoreContext();
injectShortLivedTokenForSwiftAuth();
[3/5] incubator-brooklyn git commit: Use auth endpoint from named
location instead of hardcoding
Posted by al...@apache.org.
Use auth endpoint from named location instead of hardcoding
Remove keystone references, sample location uses swift instead of swift-keystone provider.
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/431f0c47
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/431f0c47
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/431f0c47
Branch: refs/heads/master
Commit: 431f0c4722c23f4b5bfdb2a776dade5d820a1bfc
Parents: 0141dc9
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Thu Feb 5 16:28:40 2015 +0200
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Tue Mar 17 22:02:49 2015 +0200
----------------------------------------------------------------------
.../brooklyn/location/jclouds/JcloudsUtil.java | 2 +-
.../persister/jclouds/BlobStoreExpiryTest.java | 22 +++++++++++---------
2 files changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/431f0c47/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsUtil.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsUtil.java b/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsUtil.java
index eb0e605..b910e9f 100644
--- a/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsUtil.java
+++ b/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsUtil.java
@@ -262,7 +262,7 @@ public class JcloudsUtil implements JcloudsLocationConfig {
* <p>
* (Marked Beta as that argument will likely be removed.)
*
- * @since 1.7.0 */
+ * @since 0.7.0 */
@Beta
public static BlobStoreContext newBlobstoreContext(String provider, @Nullable String endpoint, String identity, String credential) {
Properties overrides = new Properties();
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/431f0c47/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/BlobStoreExpiryTest.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/BlobStoreExpiryTest.java b/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/BlobStoreExpiryTest.java
index 76618a5..3d98d20 100644
--- a/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/BlobStoreExpiryTest.java
+++ b/locations/jclouds/src/test/java/brooklyn/entity/rebind/persister/jclouds/BlobStoreExpiryTest.java
@@ -21,8 +21,9 @@ package brooklyn.entity.rebind.persister.jclouds;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.jclouds.openstack.reference.AuthHeaders.URL_SUFFIX;
-import java.io.IOException;
import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
import java.util.List;
import java.util.Map.Entry;
@@ -59,7 +60,6 @@ import com.google.common.cache.LoadingCache;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMap.Builder;
import com.google.inject.Inject;
-import com.google.inject.Module;
@Test(groups={"Live", "Live-sanity"})
public class BlobStoreExpiryTest {
@@ -122,14 +122,14 @@ public class BlobStoreExpiryTest {
context = null;
}
- public void testRenewAuthSucceedsWithOurOverride() throws IOException {
+ public void testRenewAuthSucceeds() throws Exception {
doTestRenewAuth();
}
- protected void doTestRenewAuth() throws IOException {
+ protected void doTestRenewAuth() throws Exception {
getBlobStoreContext();
- injectShortLivedTokenForKeystoneV1_1();
+ injectShortLivedTokenForSwiftAuth();
context.getBlobStore().createContainerInLocation(null, testContainerName);
@@ -149,8 +149,10 @@ public class BlobStoreExpiryTest {
BlobStoreTest.assertHasItemNamed(ps, testContainerName);
}
- private void injectShortLivedTokenForKeystoneV1_1() {
- HttpToolResponse tokenHttpResponse1 = requestTokenWithExplicitLifetime("https://keystone-endpoint/v1.1", "CHANGE_ME",
+ private void injectShortLivedTokenForSwiftAuth() throws Exception {
+ URL endpointUrl = new URL(endpoint);
+
+ HttpToolResponse tokenHttpResponse1 = requestTokenWithExplicitLifetime(endpointUrl,
identity, credential, Duration.FIVE_SECONDS);
Builder<String, URI> servicesMapBuilder = ImmutableMap.builder();
@@ -178,12 +180,12 @@ public class BlobStoreExpiryTest {
}
}
- public static HttpToolResponse requestTokenWithExplicitLifetime(String url, String host, String user, String key, Duration expiration) {
+ public static HttpToolResponse requestTokenWithExplicitLifetime(URL url, String user, String key, Duration expiration) throws URISyntaxException {
HttpClient client = HttpTool.httpClientBuilder().build();
- HttpToolResponse response = HttpTool.httpGet(client, URI.create(url), MutableMap.<String,String>of()
+ HttpToolResponse response = HttpTool.httpGet(client, url.toURI(), MutableMap.<String,String>of()
.add(AuthHeaders.AUTH_USER, user)
.add(AuthHeaders.AUTH_KEY, key)
- .add("Host", host)
+ .add("Host", url.getHost())
.add("X-Auth-New-Token", "" + true)
.add("X-Auth-Token-Lifetime", "" + expiration.toSeconds())
);
[2/5] incubator-brooklyn git commit: Remove logback customization in
camp project
Posted by al...@apache.org.
Remove logback customization in camp project
No point in having logback config in a library, messes with test output.
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/b9e2ef7e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/b9e2ef7e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/b9e2ef7e
Branch: refs/heads/master
Commit: b9e2ef7ebfaa2ec8f8f01de8130629e844316664
Parents: 431f0c4
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Thu Feb 5 16:29:51 2015 +0200
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Tue Mar 17 22:02:49 2015 +0200
----------------------------------------------------------------------
.../src/main/resources/logback-custom.xml | 28 --------------------
1 file changed, 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/b9e2ef7e/camp/camp-base/src/main/resources/logback-custom.xml
----------------------------------------------------------------------
diff --git a/camp/camp-base/src/main/resources/logback-custom.xml b/camp/camp-base/src/main/resources/logback-custom.xml
deleted file mode 100644
index 693977d..0000000
--- a/camp/camp-base/src/main/resources/logback-custom.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<included>
-
- <!-- include everything in this project at debug level -->
- <logger name="io.cloudsoft.cloudera" level="DEBUG"/>
-
- <!-- log to simple-web-cluster.log -->
- <property name="logging.basename" scope="context" value="brooklyn-camp" />
-
-</included>