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

    https://github.com/apache/incubator-brooklyn/pull/194#discussion_r18209604
  
    --- Diff: 
core/src/main/java/brooklyn/event/basic/PortAttributeSensorAndConfigKey.java ---
    @@ -94,14 +94,15 @@ protected Integer convertConfigToSensor(PortRange 
value, Entity entity) {
                 if (lo.isPresent()) {
                     Location l = lo.get();
                     Boolean skip = 
Optional.fromNullable(entity.getConfig(BrooklynConfigKeys.SKIP_INSTALLATION)).or(false);
    +                Boolean started = 
Optional.fromNullable(entity.getConfig(BrooklynConfigKeys.ENTITY_STARTED)).or(false);
                     if (l instanceof PortSupplier) {
                         int p = ((PortSupplier) l).obtainPort(value);
                         if (p != -1) {
                             LOG.debug("{}: choosing port {} for {}", new 
Object[] { entity, p, getName() });
                             return p;
                         }
    -                    // If we are not skipping install, fail now
    -                    if (!skip) {
    +                    // If we are not skipping install or already started, 
fail now
    +                    if (!(skip || started)) {
    --- End diff --
    
    Should this check not occur before the `int p = ..` block above? If the 
port supplier obtains a port then it returns early.


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