brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grkvlt <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: allow open ports to be specified ...
Date Mon, 13 Apr 2015 04:45:15 GMT
Github user grkvlt commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/592#discussion_r28214126
  
    --- Diff: software/base/src/main/java/brooklyn/entity/basic/SoftwareProcessImpl.java ---
    @@ -429,8 +432,21 @@ protected final void callStartHooks() {}
                 if (PortRange.class.isAssignableFrom(k.getType())) {
                     PortRange p = (PortRange)getConfig(k);
                     if (p != null && !p.isEmpty()) ports.add(p.iterator().next());
    +            }   
    +        }
    +        
    +        Map<String, Object> provisioningProperties = getConfig(PROVISIONING_PROPERTIES);
    +        if(provisioningProperties.containsKey("required.ports")){
    +            Object requiredPorts = provisioningProperties.get("required.ports");
    +            if (requiredPorts instanceof Integer){
    +                ports.add((Integer)requiredPorts);
    +            }else if (requiredPorts instanceof List) {
    --- End diff --
    
    Won't a cooma-separated `String` or single `Integer` get coerced to a `List<Integer>`
using a `ConfigKey` or at least you can call the appropriate `TypeCoercions#coerce(...)` method?


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