knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pzamp...@apache.org
Subject knox git commit: KNOX-1317 - Ambari service discovery config handling of nested derived properties
Date Thu, 17 May 2018 13:35:24 GMT
Repository: knox
Updated Branches:
  refs/heads/master 82e981be8 -> be4278120


KNOX-1317 - Ambari service discovery config handling of nested derived properties


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

Branch: refs/heads/master
Commit: be42781207475ed5c7e9d5015c026d3896307a75
Parents: 82e981b
Author: Phil Zampino <pzampino@apache.org>
Authored: Thu May 17 09:19:54 2018 -0400
Committer: Phil Zampino <pzampino@apache.org>
Committed: Thu May 17 09:19:54 2018 -0400

----------------------------------------------------------------------
 .../discovery/ambari/PropertyEqualsHandler.java         | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/be427812/gateway-discovery-ambari/src/main/java/org/apache/knox/gateway/topology/discovery/ambari/PropertyEqualsHandler.java
----------------------------------------------------------------------
diff --git a/gateway-discovery-ambari/src/main/java/org/apache/knox/gateway/topology/discovery/ambari/PropertyEqualsHandler.java
b/gateway-discovery-ambari/src/main/java/org/apache/knox/gateway/topology/discovery/ambari/PropertyEqualsHandler.java
index 0dfab36..6b81356 100644
--- a/gateway-discovery-ambari/src/main/java/org/apache/knox/gateway/topology/discovery/ambari/PropertyEqualsHandler.java
+++ b/gateway-discovery-ambari/src/main/java/org/apache/knox/gateway/topology/discovery/ambari/PropertyEqualsHandler.java
@@ -43,7 +43,17 @@ class PropertyEqualsHandler implements ConditionalValueHandler {
 
         ServiceURLPropertyConfig.Property p = config.getConfigProperty(serviceName, propertyName);
         if (p != null) {
-            String value = getActualPropertyValue(cluster, p);
+
+            String value = null;
+            if (p.getType().equalsIgnoreCase(ServiceURLPropertyConfig.Property.TYPE_DERIVED))
{
+                ConditionalValueHandler valueHandler = p.getConditionHandler();
+                if (valueHandler != null) {
+                    value = valueHandler.evaluate(config, cluster);
+                }
+            } else {
+                value = getActualPropertyValue(cluster, p);
+            }
+
             if (propertyValue == null) {
                 // If the property value isn't specified, then we're just checking if the
property is set with any value
                 if (value != null) {


Mime
View raw message