brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neykov <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: minor fixes to catalog and jcloud...
Date Sat, 15 Nov 2014 16:22:47 GMT
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/333#discussion_r20403279
  
    --- Diff: locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocationResolver.java
---
    @@ -177,17 +177,20 @@ public JcloudsLocation newLocationFromString(Map locationFlags,
String spec, bro
             Map jcloudsProperties = new JcloudsPropertiesFromBrooklynProperties().getJcloudsProperties(providerOrApi,
regionOrEndpoint, namedLocation, allProperties);
             jcloudsProperties.putAll(locationFlags);
             
    -        if (isProvider) {
    -            // providers from ServiceLoader take a location (endpoint already configured),
and optionally a region name
    -            // NB blank might be supplied if spec string is "mycloud:" -- that should
be respected, 
    -            // whereas no parameter/regionName ie null value -- "mycloud" -- means don't
set
    -            if (regionOrEndpoint!=null)
    -                jcloudsProperties.put(JcloudsLocationConfig.CLOUD_REGION_ID.getName(),
regionOrEndpoint);
    -        } else {
    -            // other "providers" are APIs so take an _endpoint_ (but not a location);
    -            // see note above re null here
    -            if (regionOrEndpoint!=null)
    -                jcloudsProperties.put(JcloudsLocationConfig.CLOUD_ENDPOINT.getName(),
regionOrEndpoint);
    +        if (regionOrEndpoint!=null) {
    +            // apply the regionOrEndpoint (e.g. from the parameter) as appropriate --
but only if it has not been overridden
    +            if (isProvider) {
    +                // providers from ServiceLoader take a location (endpoint already configured),
and optionally a region name
    +                // NB blank might be supplied if spec string is "mycloud:" -- that should
be respected, 
    +                // whereas no parameter/regionName ie null value -- "mycloud" -- means
don't set
    +                if (regionOrEndpoint!=null && Strings.isBlank(Strings.toString(jcloudsProperties.get(JcloudsLocationConfig.CLOUD_REGION_ID.getName()))))
    +                    jcloudsProperties.put(JcloudsLocationConfig.CLOUD_REGION_ID.getName(),
regionOrEndpoint);
    +            } else {
    +                // other "providers" are APIs so take an _endpoint_ (but not a location);
    +                // see note above re null here
    +                if (regionOrEndpoint!=null && Strings.isBlank(Strings.toString(jcloudsProperties.get(JcloudsLocationConfig.CLOUD_ENDPOINT.getName()))))
    --- End diff --
    
    != null not needed as above.


---
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.
---

Mime
View raw message