You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by bostko <gi...@git.apache.org> on 2016/07/07 18:16:25 UTC

[GitHub] brooklyn-library pull request #48: Fix NodeJsWebAppSshDriver to obtain prope...

GitHub user bostko opened a pull request:

    https://github.com/apache/brooklyn-library/pull/48

    Fix NodeJsWebAppSshDriver to obtain properly MAIN_URL

    - make NodeJsWebAppSshDriver and JavaWebAppSshDriver to use a single method
      for obtaining the MAIN_URL
    
    This should be a standardized for all entities which has to have
    an option for exposing http MAIN_URL

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/bostko/brooklyn-library accessible_web_url

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-library/pull/48.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #48
    
----
commit 46925ba91a454049bff1a66f7caa759cd7c933e6
Author: Valentin Aitken <bo...@gmail.com>
Date:   2016-07-07T17:20:25Z

    Fix NodeJsWebAppSshDriver to obtain properly MAIN_URL
    
    - make NodeJsWebAppSshDriver and JavaWebAppSshDriver to use a single method
      for obtaining the MAIN_URL
    
    This should be a standardized for all entities which has to have
    an option for exposing http MAIN_URL

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-library issue #48: Fix NodeJsWebAppSshDriver to obtain properly MAI...

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on the issue:

    https://github.com/apache/brooklyn-library/pull/48
  
    Thanks all, merging. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-library issue #48: Fix NodeJsWebAppSshDriver to obtain properly MAI...

Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on the issue:

    https://github.com/apache/brooklyn-library/pull/48
  
    LGTM; one tiny comment and then good to merge.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-library issue #48: Fix NodeJsWebAppSshDriver to obtain properly MAI...

Posted by iyovcheva <gi...@git.apache.org>.
Github user iyovcheva commented on the issue:

    https://github.com/apache/brooklyn-library/pull/48
  
    LGTM, minor comment only


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-library pull request #48: Fix NodeJsWebAppSshDriver to obtain prope...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/brooklyn-library/pull/48


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-library pull request #48: Fix NodeJsWebAppSshDriver to obtain prope...

Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/brooklyn-library/pull/48#discussion_r70430996
  
    --- Diff: software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/JavaWebAppSshDriver.java ---
    @@ -91,25 +91,17 @@ protected String getSslKeyAlias() {
             return (ssl == null) ? null : ssl.getKeyAlias();
         }
     
    +    /**
    +     * @deprecated please use {@link WebAppServiceMethods#inferBrooklynAccessibleRootUrl(org.apache.brooklyn.api.entity.Entity)}
    --- End diff --
    
    It's a good idea to include `@deprecated since 0.10.0; ...`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-library pull request #48: Fix NodeJsWebAppSshDriver to obtain prope...

Posted by iyovcheva <gi...@git.apache.org>.
Github user iyovcheva commented on a diff in the pull request:

    https://github.com/apache/brooklyn-library/pull/48#discussion_r70067818
  
    --- Diff: software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/WebAppServiceMethods.java ---
    @@ -73,17 +73,26 @@ public static boolean isProtocolEnabled(Entity entity, String protocol) {
     
         public static String inferBrooklynAccessibleRootUrl(Entity entity) {
             if (isProtocolEnabled(entity, "https")) {
    -            Integer rawPort = entity.getAttribute(HTTPS_PORT);
    -            checkNotNull(rawPort, "HTTPS_PORT sensors not set for %s; is an acceptable port available?", entity);
    -            HostAndPort hp = BrooklynAccessUtils.getBrooklynAccessibleAddress(entity, rawPort);
    -            return String.format("https://%s:%s/", hp.getHostText(), hp.getPort());
    +            return inferBrooklynAccessibleRootUrl(entity, HTTPS_PORT);
             } else if (isProtocolEnabled(entity, "http")) {
    -            Integer rawPort = entity.getAttribute(HTTP_PORT);
    -            checkNotNull(rawPort, "HTTP_PORT sensors not set for %s; is an acceptable port available?", entity);
    -            HostAndPort hp = BrooklynAccessUtils.getBrooklynAccessibleAddress(entity, rawPort);
    -            return String.format("http://%s:%s/", hp.getHostText(), hp.getPort());
    +            return inferBrooklynAccessibleRootUrl(entity, HTTP_PORT);
             } else {
                 throw new IllegalStateException("HTTP and HTTPS protocols not enabled for "+entity+"; enabled protocols are "+getEnabledProtocols(entity));
             }
         }
    +
    +    public static String inferBrooklynAccessibleRootUrl(Entity entity, AttributeSensor<Integer> sensor) {
    --- End diff --
    
    I don't think we need inferBrooklynAccessibleRootUrl(Entity entity, AttributeSensor<Integer> sensor) signature as there are not defined other protocols yet and there is double check once in inferBrooklynAccessibleRootUrl(Entity entity) and once here. A sensor can be set in the first method instead and this would simplify the code.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---