You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Jeremy Daggett <no...@github.com> on 2014/08/01 20:18:06 UTC

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

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)

Posted by Everett Toews <no...@github.com>.
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)

Posted by Jeremy Daggett <no...@github.com>.
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)

Posted by Andrew Phillips <no...@github.com>.
> +                  .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)

Posted by Andrew Phillips <no...@github.com>.
>   */
>  @Singleton
>  public class InternalURL implements EndpointToSupplierURI {
>     @Override
>     public Supplier<URI> 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)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[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)

Posted by Everett Toews <no...@github.com>.
Closed #462.

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

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

Posted by Andrew Phillips <no...@github.com>.
> +      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

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

Posted by Everett Toews <no...@github.com>.
+1 after comments addressed.

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

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

Posted by CloudBees pull request builder plugin <no...@github.com>.
[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