Re: [jclouds] JCLOUDS-642: InternalUrl fallback (#462)

2015-03-24 Thread Everett Toews
Thanks for the pull request but it's release week in jclouds and that means 
it's time to clean up the PR queue. This PR will be over 6 months old as of 
April 1. If you intend to continue work on it, please make a comment by April 
2. Otherwise it will be closed on April 3.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/462#issuecomment-85714738

Re: [jclouds] JCLOUDS-642: InternalUrl fallback (#462)

2014-08-04 Thread Everett Toews
+1 after comments addressed.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/462#issuecomment-51085775

[jclouds] JCLOUDS-642: InternalUrl fallback (#462)

2014-08-01 Thread Jeremy Daggett
This PR provides the necessary changes for 
[JCLOUDS-642](https://issues.apache.org/jira/browse/JCLOUDS-642). `InternalURL` 
should fallback to use `publicUrl` if the `internalUrl` is not present for the 
endpoint.
 
This is a WIP pending testing and could use feedback on the changes in the 
meantime. DO NOT MERGE! Thx!
You can merge this Pull Request by running:

  git pull https://github.com/rackspace/jclouds fix/internal-url-fallback

Or you can view, comment on it, or merge it online at:

  https://github.com/jclouds/jclouds/pull/462

-- Commit Summary --

  * JCLOUDS-642: InternalURL should fallback to use public URL

-- File Changes --

M 
apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/functions/InternalURL.java
 (6)
M 
apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/functions/InternalURLTest.java
 (98)

-- Patch Links --

https://github.com/jclouds/jclouds/pull/462.patch
https://github.com/jclouds/jclouds/pull/462.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/462


Re: [jclouds] JCLOUDS-642: InternalUrl fallback (#462)

2014-08-01 Thread Jeremy Daggett
Note the JIRA and PR ids for this work. That isn't confusing at all! :)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/462#issuecomment-50917589

Re: [jclouds] JCLOUDS-642: InternalUrl fallback (#462)

2014-08-01 Thread CloudBees pull request builder plugin
[jclouds-pull-requests 
#1049](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/1049/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/462#issuecomment-50924250

Re: [jclouds] JCLOUDS-642: InternalUrl fallback (#462)

2014-08-01 Thread CloudBees pull request builder plugin
[jclouds-java-7-pull-requests 
#1521](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/1521/) 
UNSTABLE
Looks like there's a problem with this pull request

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/462#issuecomment-50925038

Re: [jclouds] JCLOUDS-642: InternalUrl fallback (#462)

2014-08-01 Thread Andrew Phillips
   */
  @Singleton
  public class InternalURL implements EndpointToSupplierURI {
 @Override
 public SupplierURI apply(Endpoint input) {
 -  return Suppliers.ofInstance(input.getInternalURL());
 +  return Suppliers.ofInstance(input.getInternalURL() != null ? 
 input.getInternalURL() : input.getPublicURL());

Could also be 
[`MoreObjects.firstNonNull`](http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/base/MoreObjects.html#firstNonNull\(T,
 T\))

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/462/files#r15715147

Re: [jclouds] JCLOUDS-642: InternalUrl fallback (#462)

2014-08-01 Thread Andrew Phillips
 +  .build()).get(),
 +
 URI.create(https://ericsson.com/v2/1900e98b-7272-4cbd-8e95-0b8c2a9266c0;));
 +   }
 +
 +   /**
 +* If the {@code internalURL} is absent, then {@link InternalURL} will 
 fallback to
 +* use the {@code publicURL}
 +*/
 +   public void testInternalURLAbsentAndFallbackToPublicURL() {
 +  assertEquals(
 +fn.apply(Endpoint.builder().region(regionOne).versionId(2.0)
 +   
 .publicURL(URI.create(https://ericsson.com/v2/1900e98b-7272-4cbd-8e95-0b8c2a9266c0;))
 +   
 .adminURL(URI.create(https://admin.ericsson.com/v2/1900e98b-7272-4cbd-8e95-0b8c2a9266c0;))
 +  .build()).get(),
 +
 URI.create(https://ericsson.com/v2/1900e98b-7272-4cbd-8e95-0b8c2a9266c0;));
 +   }

[minor] Perhaps rename the three tests to something like `testInternalURLOnly`, 
`testPublicURLOnly`, `testInternalAndPublicURL` or so?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/462/files#r15715308

Re: [jclouds] JCLOUDS-642: InternalUrl fallback (#462)

2014-08-01 Thread Andrew Phillips
 +  assertEquals(
 +fn.apply(Endpoint.builder().region(regionOne).versionId(2.0)
 +   
 .publicURL(URI.create(https://ericsson.com/v2/1900e98b-7272-4cbd-8e95-0b8c2a9266c0;))
 +  .build()).get(),
 +
 URI.create(https://ericsson.com/v2/1900e98b-7272-4cbd-8e95-0b8c2a9266c0;));
 +   }
 +
 +   /**
 +* If the {@code internalURL} is absent, then {@link InternalURL} will 
 fallback to
 +* use the {@code publicURL}
 +*/
 +   public void testInternalURLAbsentAndFallbackToPublicURL() {
 +  assertEquals(
 +fn.apply(Endpoint.builder().region(regionOne).versionId(2.0)
 +   
 .publicURL(URI.create(https://ericsson.com/v2/1900e98b-7272-4cbd-8e95-0b8c2a9266c0;))
 +   
 .adminURL(URI.create(https://admin.ericsson.com/v2/1900e98b-7272-4cbd-8e95-0b8c2a9266c0;))

How is this different from `InternalURLAbsent`?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/462/files#r15715354