Github user grkvlt commented on a diff in the pull request:

    https://github.com/apache/brooklyn-library/pull/44#discussion_r67509788
  
    --- Diff: 
software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/riak/RiakNodeImpl.java
 ---
    @@ -99,17 +110,59 @@ public boolean isPackageDownloadUrlProvided() {
     
         @Override
         protected Collection<Integer> getRequiredOpenPorts() {
    -        // TODO this creates a huge list of inbound ports; much better to 
define on a security group using range syntax!
    -        int erlangRangeStart = 
getConfig(ERLANG_PORT_RANGE_START).iterator().next();
    -        int erlangRangeEnd = 
getConfig(ERLANG_PORT_RANGE_END).iterator().next();
    +        PortRange erlangPorts = config().get(ERLANG_PORT_RANGE);
    +        Integer erlangRangeStart = config().get(ERLANG_PORT_RANGE_START);
    +        Integer erlangRangeEnd = config().get(ERLANG_PORT_RANGE_END);
    +        if (erlangRangeStart == null) erlangRangeStart = 
Iterables.get(erlangPorts, 0);
    +        if (erlangRangeEnd == null) erlangRangeEnd = 
Iterables.getLast(erlangPorts);
    +        sensors().set(ERLANG_PORT_RANGE_START, erlangRangeStart);
    +        sensors().set(ERLANG_PORT_RANGE_END, erlangRangeEnd);
    +
    +        boolean configureInternalNetworking = 
config().get(CONFIGURE_INTERNAL_NETWORKING);
    +        if (configureInternalNetworking) {
    +            configureInternalNetworking();
    +        }
     
    -        Set<Integer> ports = 
MutableSet.copyOf(super.getRequiredOpenPorts());
    -        Set<Integer> erlangPorts = 
ContiguousSet.create(Range.open(erlangRangeStart, erlangRangeEnd), 
DiscreteDomain.integers());
    -        ports.addAll(erlangPorts);
    +        return super.getRequiredOpenPorts();
    +    }
     
    -        return ports;
    +    private void configureInternalNetworking() {
    +        Location location = getDriver().getLocation();
    +        if (!(location instanceof JcloudsSshMachineLocation)) {
    +            LOG.info("Not running in a JcloudsSshMachineLocation, not 
adding IP permissions to {}", this);
    +            return;
    +        }
    +        JcloudsMachineLocation machine = (JcloudsMachineLocation) location;
    +        JcloudsLocationSecurityGroupCustomizer customizer = 
JcloudsLocationSecurityGroupCustomizer.getInstance(getApplicationId());
    +
    +        synchronized (getParent()) {
    +            String cidr = Cidr.UNIVERSAL.toString(); // TODO use more 
appropriate CIDR
    --- End diff --
    
    Yes, I mean more _restrictive_ CIDR, really. But I don't think we have a 
good way of getting the network address for the hosts in Brooklyn at present.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to