Repository: brooklyn-server
Updated Branches:
  refs/heads/master 6693cd0cd -> f9a59e5d4


Fixes port inference for dynamically added ConfigKeys


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/e98b1581
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/e98b1581
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/e98b1581

Branch: refs/heads/master
Commit: e98b15811a6f5d9af70ebe34b738e27e13969c1b
Parents: 90eb128
Author: Robert Moss <robert.m...@cloudsoftcorp.com>
Authored: Wed Feb 10 15:54:02 2016 +0000
Committer: Robert Moss <robert.m...@cloudsoftcorp.com>
Committed: Wed Feb 10 15:54:02 2016 +0000

----------------------------------------------------------------------
 .../apache/brooklyn/entity/software/base/InboundPortsUtils.java   | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/e98b1581/software/base/src/main/java/org/apache/brooklyn/entity/software/base/InboundPortsUtils.java
----------------------------------------------------------------------
diff --git 
a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/InboundPortsUtils.java
 
b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/InboundPortsUtils.java
index adc7b58..73e7a86 100644
--- 
a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/InboundPortsUtils.java
+++ 
b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/InboundPortsUtils.java
@@ -24,6 +24,7 @@ import com.google.common.reflect.TypeToken;
 import org.apache.brooklyn.api.entity.Entity;
 import org.apache.brooklyn.api.location.PortRange;
 import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.entity.EntityInternal;
 import org.apache.brooklyn.util.collections.MutableSet;
 import org.apache.brooklyn.util.core.flags.TypeCoercions;
 import org.apache.brooklyn.util.guava.Maybe;
@@ -75,6 +76,8 @@ public class InboundPortsUtils {
         if (portsAutoInfer == null || portsAutoInfer.booleanValue()) { // 
auto-infer defaults to true if not specified
             Set<ConfigKey<?>> configKeys = Sets.newHashSet(extraConfigKeys);
             configKeys.addAll(entity.getEntityType().getConfigKeys());
+            // Also add dynamically added config keys
+            
configKeys.addAll(((EntityInternal)entity).config().getBag().getAllConfigAsConfigKeyMap().keySet());
 
             if (portRegex == null) portRegex = ".*\\.port"; // defaults to 
legacy regex if not specified
             Pattern portsPattern = Pattern.compile(portRegex);

Reply via email to