brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [10/28] brooklyn-server git commit: need to restrict keys to those present for ssh commands
Date Wed, 15 Feb 2017 18:31:03 GMT
need to restrict keys to those present for ssh commands

else we pick up `null` values ... alternatively could take declared and filter for nulls,
but this change restores the old working behaviour

if ever we need to get default values of keys when passing in this way, we should revert this
and filter null values


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

Branch: refs/heads/master
Commit: cc639c52c28b4337eb4b638bfd4182c775891e50
Parents: 1a67170
Author: Alex Heneveld <alex@Alexs-MacBook-Pro.local>
Authored: Tue Dec 6 10:03:04 2016 +0000
Committer: Alex Heneveld <alex@Alexs-MacBook-Pro.local>
Committed: Tue Dec 6 10:13:24 2016 +0000

----------------------------------------------------------------------
 .../org/apache/brooklyn/core/effector/ssh/SshEffectorTasks.java  | 4 ++--
 .../java/org/apache/brooklyn/util/core/task/ssh/SshTasks.java    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/cc639c52/core/src/main/java/org/apache/brooklyn/core/effector/ssh/SshEffectorTasks.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/effector/ssh/SshEffectorTasks.java
b/core/src/main/java/org/apache/brooklyn/core/effector/ssh/SshEffectorTasks.java
index 24bc666..76acd3a 100644
--- a/core/src/main/java/org/apache/brooklyn/core/effector/ssh/SshEffectorTasks.java
+++ b/core/src/main/java/org/apache/brooklyn/core/effector/ssh/SshEffectorTasks.java
@@ -296,10 +296,10 @@ public class SshEffectorTasks {
     public static Map<String, Object> getSshFlags(Entity entity, Location optionalLocation)
{
         Set<ConfigKey<?>> sshConfig = MutableSet.of();
         
-        sshConfig.addAll(((EntityInternal)entity).config().findKeysDeclared(ConfigPredicates.nameStartsWith(SshTool.BROOKLYN_CONFIG_KEY_PREFIX)));
+        sshConfig.addAll(((EntityInternal)entity).config().findKeysPresent(ConfigPredicates.nameStartsWith(SshTool.BROOKLYN_CONFIG_KEY_PREFIX)));
         
         if (optionalLocation!=null)
-            sshConfig.addAll(optionalLocation.config().findKeysDeclared(ConfigPredicates.nameStartsWith(SshTool.BROOKLYN_CONFIG_KEY_PREFIX)));
+            sshConfig.addAll(optionalLocation.config().findKeysPresent(ConfigPredicates.nameStartsWith(SshTool.BROOKLYN_CONFIG_KEY_PREFIX)));
         
         StringConfigMap globalConfig = ((EntityInternal)entity).getManagementContext().getConfig();
         sshConfig.addAll(globalConfig.findKeysDeclared(ConfigPredicates.nameStartsWith(SshTool.BROOKLYN_CONFIG_KEY_PREFIX)));

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/cc639c52/core/src/main/java/org/apache/brooklyn/util/core/task/ssh/SshTasks.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/util/core/task/ssh/SshTasks.java b/core/src/main/java/org/apache/brooklyn/util/core/task/ssh/SshTasks.java
index c616e1c..51a060e 100644
--- a/core/src/main/java/org/apache/brooklyn/util/core/task/ssh/SshTasks.java
+++ b/core/src/main/java/org/apache/brooklyn/util/core/task/ssh/SshTasks.java
@@ -128,12 +128,12 @@ public class SshTasks {
         Set<ConfigKey<?>> sshConfig = MutableSet.of();
         
         StringConfigMap mgmtConfig = null;
-        sshConfig.addAll(location.config().findKeysDeclared(ConfigPredicates.nameStartsWith(SshTool.BROOKLYN_CONFIG_KEY_PREFIX)));
+        sshConfig.addAll(location.config().findKeysPresent(ConfigPredicates.nameStartsWith(SshTool.BROOKLYN_CONFIG_KEY_PREFIX)));
         if (location instanceof AbstractLocation) {
             ManagementContext mgmt = ((AbstractLocation)location).getManagementContext();
             if (mgmt!=null) {
                 mgmtConfig = mgmt.getConfig();
-                sshConfig.addAll(mgmtConfig.findKeysDeclared(ConfigPredicates.nameStartsWith(SshTool.BROOKLYN_CONFIG_KEY_PREFIX)));
+                sshConfig.addAll(mgmtConfig.findKeysPresent(ConfigPredicates.nameStartsWith(SshTool.BROOKLYN_CONFIG_KEY_PREFIX)));
             }
         }
         


Mime
View raw message