brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [1/2] incubator-brooklyn git commit: Props given as arguments to SshMachineLocation.connectSsh trump others
Date Fri, 06 Mar 2015 16:29:57 GMT
Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master 2066ea95f -> 580e96ff0


Props given as arguments to SshMachineLocation.connectSsh trump others

So, for example, the user that the SSH connection is made as can be
overridden by providing PROP_USER in the flags. Previously it was
overwritten by the inclusion of the config in config().getBag().


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

Branch: refs/heads/master
Commit: 2fb0768e9b0fc98b87b7d132d9c1f24f10e34201
Parents: dfdc687
Author: Sam Corbett <sam.corbett@cloudsoftcorp.com>
Authored: Fri Mar 6 12:27:02 2015 +0000
Committer: Sam Corbett <sam.corbett@cloudsoftcorp.com>
Committed: Fri Mar 6 12:28:38 2015 +0000

----------------------------------------------------------------------
 .../main/java/brooklyn/location/basic/SshMachineLocation.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2fb0768e/core/src/main/java/brooklyn/location/basic/SshMachineLocation.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/location/basic/SshMachineLocation.java b/core/src/main/java/brooklyn/location/basic/SshMachineLocation.java
index 51b96c6..40dc1e5 100644
--- a/core/src/main/java/brooklyn/location/basic/SshMachineLocation.java
+++ b/core/src/main/java/brooklyn/location/basic/SshMachineLocation.java
@@ -529,8 +529,7 @@ public class SshMachineLocation extends AbstractLocation implements MachineLocat
             ConfigBag args = new ConfigBag()
                 .configure(SshTool.PROP_USER, user)
                 // default value of host, overridden if SSH_HOST is supplied
-                .configure(SshTool.PROP_HOST, address.getHostName())
-                .putAll(props);
+                .configure(SshTool.PROP_HOST, address.getHostName());
 
             for (Map.Entry<String,Object> entry: config().getBag().getAllConfig().entrySet())
{
                 String key = entry.getKey();
@@ -550,6 +549,10 @@ public class SshMachineLocation extends AbstractLocation implements MachineLocat
                 }
                 args.putStringKey(key, entry.getValue());
             }
+
+            // Explicit props trump all.
+            args.putAll(props);
+
             if (LOG.isTraceEnabled()) LOG.trace("creating ssh session for "+args);
             if (!user.equals(args.get(SshTool.PROP_USER))) {
                 LOG.warn("User mismatch configuring ssh for "+this+": preferring user "+args.get(SshTool.PROP_USER)+"
over "+user);


Mime
View raw message